-
Notifications
You must be signed in to change notification settings - Fork 605
Cross compilation std::to_string error based on OpenWRT toolchain #77
Comments
std::string to_string ( added since c++ 11)
now try to compile this code with do you get same compile errors ?
|
Hi there - you may also want to confirm your dependencies are up to date, and pass -std=c++11 to the compiler. This has also been reported by others per the following links, and suggests either gcc 4.8.1 is simply non-compliant to the C++11 std::string, or you need to invoke it differently: https://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-g-mingw Let us know if the problem persists, thanks. |
Thanks for the reply.
and the code as follows, `
#endif
It's seems can avoided "to_string' is not a member of 'std'" error in BufferLayout.h and ExceptionEncounteredSenderTest.cpp files, but got an another error regarding undefined reference to `alexaClientSDK::xxxxxx, due to unfamiliarity with the alexa SDK, have any suggestion on it. Thanks. Error log: |
in ExceptionEncounteredSenderTest.cpp
make this modification
maybe this conversion doesn't fit here
you may need to make more specific conversion for each type
|
Thanks both for following up on this. Yes, this looks like a C++11 feature that was missed in at least GCC 4.8.1. Your workarounds for using that compiler, as posted above, look correct. If you have further issues, would you consider updating gcc to at least 4.8.5? We've identified this as a minimum version with which you can fully compile our SDK code. Please continue to update this thread if the above solutions are not sufficient, thanks. |
Thanks for reply and check. Make changes in BufferLayout.h provide by alexsalnikov, seems can fix this compilation error. Hope it may not caused any side effect. Thanks. That's means Alexa SDK can keep going compiler, but got an error as follows, [ 74%] Built target AudioInputProcessorTest Apparently, error on sqlite3.h can't found. I have check our environment, the header bas been in sqlite-3.19.3 dir. And do cmake with these options in makefile:
I have add regrading sqlite options with camke build. Is there anything missing? I can see compiler message as shown Here is CMakeCache.txt |
Hi Carlos. std::to_string is a utility function within the C++11 Standard Library, whose purpose is to convert various types into a std::string, so you shouldn't expect any side-effects from the implementation suggested above, especially since it will use an equivalent library implementation. Your sqlite3.h issue looks like your include paths are not correct. If the file exists in your build environment, then either check that it's not hidden from the build by file / directory permissions, and also that your include dir: "$(TOP)/sqlite-3.19.3/" really expands to the directory you think it does. Per your CMakeCache.txt, this reads as: /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/sqlite-3.19.3/ Let us know if this helps. |
Hi dhpp, Thanks for your help. So I do not know which cmake options are missing or perhaps caused by other errors. |
Hi [ 19%] Building CXX object AVSCommon/CMakeFiles/AVSCommon.dir/Utils/src/Logger/LoggerSinkManager.cpp.o Thanks. |
Hi Carlos, The error you're getting tells us that the file LoggerUtils.cpp is missing a required include, and it would seem that our own test and build environment did not require us to explicitly include it. Please add this line: #include <stdio.h> just before the namespace declarations in that file. I'll also have our SDK updated for the next release to include this header. This will resolve your snprintf error. Thanks for helping us identify these issues. Please let us know if you have any further problems, or if you now get a complete build. |
Hi Carlos - sorry I skipped over your earlier post with respect to sqlite3.h. This reads to me as simply an include directory issue. For some reason, the directory where the file is located cannot be accessed by your build tools. This is either caused by misconfigured CMake instructions (particularly telling it which directories to look for header files), or some other aspect of your build environment. I find in cases like this an easy way to debug is to try moving the problematic header file somewhere else, where you know other files are being included OK, to see if that works. If it doesn't you have other problems. If it does work, then you can either decide to simply place the file somewhere else (if in the end you can't determine why CMake can't find it), or it may give you enough extra information to solve what's confusing CMake. Hope this helps. |
Hi dhpp, For sqlite3.h, follow your suggestions, I have move the header file to simply place, but the issue still persist. Then my solution is added relative path for sqlite in CMakeLists.txt which is includes the sqlite3.h file. as follows, So I think CMake with the SQLITE_XXXXX series options are not working properly on our build environment. Thanks for your support. In addition, refering the README.md, in order to get the token that in Integration/AlexaClientSDKConfig.json file , it should using python tool to build-up local server. Have any possible have others way to generate the token? We do not consider porting python to an embedded system. So if not get the token, then run make test all, it will get all cases failed ? Is it correct? Thanks. |
Hi @CarlosHua, You don't necessarily need need to port the python to your embedded system. You only need to get the refresh token once, so this can be done on your local system. This same refresh token is used every time you connect to AVS. Hope that helps and apologies for the delay! Thanks, |
Changes in this update - Implemented `setOffSet` in `MediaPlayer`. - Updated `LoggerUtils.cpp` to address (#77). - Bug fix to address incorrect stop behavior caused when Audio Focus is set to `NONE` and released. This addresses (#129). - Bug fix for intermittent failure in `handleMultipleConsecutiveSpeaks`. - Bug fix for `jsonArrayExist` incorrectly parsing JSON when trying to locate array children. - Bug fix for ADSL test failures with `sendDirectiveWithoutADialogRequestId`. - Bug fix for `SpeechSynthesizer` showing the wrong UX state when a burst of `Speak` directives are received. - Bug fix for recursive loop in `AudioPlayer.Stop`.
Hi, I also use the openwrt cross compiler to compile the c++ alexa-device-sdk .I solve the above problems with your solutions .Thanks very much . But There is another error when linking the libSENSORY.so as follows: [ 66%] Built target KWD I have searched the error but no solutions .If you have any ideas Please tell me. Thanks!!! |
@future1122 : I had this same issue. set(CMAKE_CXX_STANDARD 11) # C++11... |
@thevamad yes it works .Thanks! |
Hi @future1122 and @thevamad, I met the same problem. There is a lot of "CMakelists.txt". Did you make change to the file in the root folder, or just under "KWD/Sensory/src", or "KWD/Sensory/test"? Thanks |
Hi @subjectxbj the solution @thevamad given is to support c++11 to fix this issue: How do i fix my issue like yours mentioned above:My boss asked others to build the libsnsr.a with our toolchain. But the source code of libsnsr.a is not available .So you can try to ask who built the libsnsr.a here. |
Hi @future1122 , And you mean the link error is actually introduced by "libsnsr.a" that is linked in libSENSORY.so. Right? And we need to ask sensory to build a new libsnsr.a for me. |
As Amazon-Ori Neidich/Clint Ory mentioned, file the ticket directly here, so
We got the compilation error on std::to_string function when porting AVS SDK-v1.0. We have try our cross compiler of gcc version as 4.8.3 and 5.2.0. But the error persists based on these gcc version. The to_string function supported since gcc4.8.0 standard C++ 11 which is means that our current version should meet the requirements.
But we still got an error based on OpenWRT toolchain with uClibc, please help on it. Thanks.
There is cmake with the compiler options,
-DCMAKE_CXX_FLAGS="-g -std=c++11 -Wall"
-DCMAKE_BUILD_TYPE="MINSIZEREL"
-DCMAKE_INSTALL_PREFIX=/usr
-DCURL_LIBRARY="$(TOP)/curl-7.54.1/lib/.libs/libcurl.so.4.4.0"
-DCURL_INCLUDE_DIR="$(TOP)/curl-7.54.1/include/"
-DDOXYGEN_EXECUTABLE="$(STAGEDIR)/usr/bin/doxygen"
-DSQLITE_sqlite3_LIBDIR="$(TOP)/sqlite-3.19.3/.libs/libsqlite3.so.0"
-DSQLITE_LIBDIR="$(TOP)/sqlite-3.19.3/.libs/libsqlite3.so.0"
-DSQLITE_INCLUDEDIR="$(TOP)/sqlite-3.19.3/"
Compiler error log as follows,
carlos@SW5-Server-50:~/Working/release/asuswrt/release/src-qca-dakota/router$ make alexa-client
"CLM In /wl/clm/src/ NOT CREATING new clm_blob ..."
rm -rf alexa-client-build && mkdir -p alexa-client-build && cd alexa-client-build &&
cmake ../alexa-client-v1.0
-DCMAKE_CXX_FLAGS="-g -std=c++11 -Wall"
-DCMAKE_BUILD_TYPE="MINSIZEREL"
-DCMAKE_INSTALL_PREFIX=/usr
-DCURL_LIBRARY="/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/curl-7.54.1/lib/.libs/libcurl.so.4.4.0"
-DCURL_INCLUDE_DIR="/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/curl-7.54.1/include/"
-DDOXYGEN_EXECUTABLE="/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/arm-uclibc/stage/usr/bin/doxygen"
-DSQLITE_sqlite3_LIBDIR="/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/sqlite-3.19.3/.libs/libsqlite3.so.0"
-DSQLITE_LIBDIR="/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/sqlite-3.19.3/.libs/libsqlite3.so.0"
-DSQLITE_INCLUDEDIR="/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/sqlite-3.19.3/"
-- The CXX compiler identification is GNU 4.8.3
-- Check for working CXX compiler: /opt/openwrt-gcc483.arm/bin/arm-openwrt-linux-uclibcgnueabi-g++
-- Check for working CXX compiler: /opt/openwrt-gcc483.arm/bin/arm-openwrt-linux-uclibcgnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Creating the build directory for the AlexaClientSDK with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/CMakeLists.txt:3 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 4.8.3
-- Check for working C compiler: /opt/openwrt-gcc483.arm/bin/arm-openwrt-linux-uclibcgnueabi-gcc
-- Check for working C compiler: /opt/openwrt-gcc483.arm/bin/arm-openwrt-linux-uclibcgnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/googlemock/CMakeLists.txt:40 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 4.8.3
-- Check for working C compiler: /opt/openwrt-gcc483.arm/bin/arm-openwrt-linux-uclibcgnueabi-gcc
-- Check for working C compiler: /opt/openwrt-gcc483.arm/bin/arm-openwrt-linux-uclibcgnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/googlemock/CMakeLists.txt:40 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at ThirdParty/googletest-release-1.8.0/googletest/CMakeLists.txt:47 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.9")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CURL: /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/curl-7.54.1/lib/.libs/libcurl.so.4.4.0 (found suitable version "7.54.1", minimum required is "7.43.0")
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the ACL with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the AuthDelegate with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the ADSL with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the AFML with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the ContextManager with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the MediaPlayer with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
GStreamer based media player will not be built.
Creating the build directory for the PlaylistParser with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
Totem-Pl-Parser based playlist parser will not be built, and the playlist parser is disabled.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the CapabilityAgents with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
Creating the build directory for the AIP with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the Alerts with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'sqlite3'
-- found sqlite3, version 3.19.3
Creating the build directory for the AudioPlayer with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
Creating the build directory for the SpeechSynthesizer with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
Creating the build directory for the Integration with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Please fill /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-build/Integration/AlexaClientSDKConfig.json before you execute integration tests.
Creating the build directory for the ApplicationUtilities with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
Creating the build directory for the DefaultClient with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
Creating the build directory for the SampleApp with build type: MINSIZEREL
No keyword detector type specified, skipping build of keyword detector.
/home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/arm-uclibc/stage/usr/bin/doxygen: /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/arm-uclibc/stage/usr/bin/doxygen: cannot execute binary file
-- Found Doxygen: /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/arm-uclibc/stage/usr/bin/doxygen
-- Configuring done
-- Generating done
-- Build files have been written to: /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-build
make -C alexa-client-build && make alexa-client-build-stage
make[1]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' make[2]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' Scanning dependencies of target gmock make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' [ 0%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock.dir/__/googletest/src/gtest-all.cc.o [ 1%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o Linking CXX static library libgmock.a make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'[ 1%] Built target gmock
make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' Scanning dependencies of target gmock_main make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' [ 2%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/__/googletest/src/gtest-all.cc.o [ 2%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o [ 3%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o Linking CXX static library libgmock_main.a make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'[ 3%] Built target gmock_main
make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' Scanning dependencies of target gtest make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' [ 4%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o Linking CXX static library libgtest.a make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'[ 4%] Built target gtest
make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' Scanning dependencies of target gtest_main make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' [ 5%] Building CXX object ThirdParty/googletest-release-1.8.0/googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o Linking CXX static library libgtest_main.a make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'[ 5%] Built target gtest_main
make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' Scanning dependencies of target AVSCommon make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[3]: Entering directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' [ 5%] Building CXX object AVSCommon/CMakeFiles/AVSCommon.dir/AVS/src/AlexaClientSDKInit.cpp.o [ 6%] Building CXX object AVSCommon/CMakeFiles/AVSCommon.dir/AVS/src/Attachment/Attachment.cpp.o In file included from /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/Utils/include/AVSCommon/Utils/SDS/SharedDataStream.h:468:0, from /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/Utils/include/AVSCommon/Utils/SDS/InProcessSDS.h:27, from /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/AVS/include/AVSCommon/AVS/Attachment/Attachment.h:27, from /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/AVS/src/Attachment/Attachment.cpp:18: /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/Utils/include/AVSCommon/Utils/SDS/BufferLayout.h: In member function 'bool alexaClientSDK::avsCommon::utils::sds::SharedDataStream<T>::BufferLayout::attach()': /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/Utils/include/AVSCommon/Utils/SDS/BufferLayout.h:514:43: error: 'to_string' is not a member of 'std' .d("expectedMagicNumber", std::to_string(MAGIC_NUMBER))); ^ /home/carlos/Working/release/asuswrt/release/src-qca-dakota/router/alexa-client-v1.0/AVSCommon/Utils/include/AVSCommon/Utils/SDS/BufferLayout.h:521:39: error: 'to_string' is not a member of 'std' .d("expectedVersion", std::to_string(VERSION))); ^ make[3]: *** [AVSCommon/CMakeFiles/AVSCommon.dir/AVS/src/Attachment/Attachment.cpp.o] Error 1 make[3]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make[2]: *** [AVSCommon/CMakeFiles/AVSCommon.dir/all] Error 2
make[2]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build' make[1]: *** [all] Error 2 make[1]: Leaving directory
/home/carlos/Working/release/asuswrt/release/src/router/alexa-client-build'make: *** [alexa-client] Error 2
The text was updated successfully, but these errors were encountered: