aws/aws-iot-device-sdk-cpp

Using library with cross-compile toolchain

Giulio89 opened this issue · 3 comments

Hi everyone,
I have just compiled the library on Raspberry PI (native build) without any problem. At the end of the compiling step I have performed a "sudo make install", so the library was copied into /usr/local/lib/libaws-iot-sdk-cpp.so and the include files into /usr/local/include folder.

Now I set up the eclipse in order to cross compile the Shadow sample. I create a sysroot folder on host machine where I copied /usr and /lib folder from Raspberry PI. I created the project where the sorce file are:

  • ConfigCommon.ccp, ConfigCommon.hpp
  • OpenSSLConnection.cpp, OpenSSLConnection.hpp
  • ShadowDelta.cpp, ShadowDelta.hpp

Then I correctly compiled the source code (for all source files) with this command:

arm-linux-gnueabihf-g++ -std=gnu++11 -I/home/rasp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3 -I/home/rasp/raspi/sysroot/usr/include -I/home/rasp/raspi/sysroot/usr/local/include -I/home/rasp/raspi/sysroot/usr/include/arm-linux-gnueabihf -O0 -g3 -Wall -c -fmessage-length=0 --sysroot=/home/rasp/raspi/sysroot -MMD -MP -MF"src/ConfigCommon.d" -MT"src/ConfigCommon.o" -o "src/ConfigCommon.o" "../src/ConfigCommon.cpp"

arm-linux-gnueabihf-g++ -std=gnu++11 -I/home/rasp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3 -I/home/rasp/raspi/sysroot/usr/include -I/home/rasp/raspi/sysroot/usr/local/include -I/home/rasp/raspi/sysroot/usr/include/arm-linux-gnueabihf -O0 -g3 -Wall -c -fmessage-length=0 --sysroot=/home/rasp/raspi/sysroot -MMD -MP -MF"src/OpenSSLConnection.d" -MT"src/OpenSSLConnection.o" -o "src/OpenSSLConnection.o" "../src/OpenSSLConnection.cpp"

arm-linux-gnueabihf-g++ -std=gnu++11 -I/home/rasp/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3 -I/home/rasp/raspi/sysroot/usr/include -I/home/rasp/raspi/sysroot/usr/local/include -I/home/rasp/raspi/sysroot/usr/include/arm-linux-gnueabihf -O0 -g3 -Wall -c -fmessage-length=0 --sysroot=/home/rasp/raspi/sysroot -MMD -MP -MF"src/ShadowDelta.d" -MT"src/ShadowDelta.o" -o "src/ShadowDelta.o" "../src/ShadowDelta.cpp"

Then I perform the linking step with the follow command:

arm-linux-gnueabihf-g++ -L/usr/local/lib -L/usr/lib -L/usr/lib/arm-linux-gnueabihf -L/lib/arm-linux-gnueabihf --sysroot=/home/rasp/raspi/sysroot -pthread -o "testAws" ./src/ConfigCommon.o ./src/OpenSSLConnection.o ./src/ShadowDelta.o -laws-iot-sdk-cpp -lcrypto -lssl -ldl

but the result is:

./src/ConfigCommon.o: in the function "awsiotsdk::ConfigCommon::LogParseError(awsiotsdk::ResponseCode const&, rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, std::string)": /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:110: undefined reference to "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" ./src/ConfigCommon.o: nella funzione "awsiotsdk::ConfigCommon::InitializeCommon(std::string const&)": /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:134: undefined reference to "awsiotsdk::util::JsonParser::InitializeFromJsonFile(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&, std::string const&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:136: undefined reference to "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:146: riferimento non definito a "awsiotsdk::util::JsonParser::GetStringValue(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, char const*, std::string&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:173: riferimento non definito a "awsiotsdk::util::JsonParser::GetStringValue(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, char const*, std::string&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:185: riferimento non definito a "awsiotsdk::util::JsonParser::GetStringValue(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, char const*, std::string&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:197: riferimento non definito a "awsiotsdk::util::JsonParser::GetStringValue(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, char const*, std::string&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:209: riferimento non definito a "awsiotsdk::util::JsonParser::GetStringValue(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, char const*, std::string&)" ./src/ConfigCommon.o:/home/rasp/eclipse-workspace/testAws/Debug/../src/ConfigCommon.cpp:215: seguono ulteriori riferimenti non definiti a "awsiotsdk::util::JsonParser::GetStringValue(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator> const&, char const*, std::string&)" ./src/OpenSSLConnection.o:(.rodata+0x2e4): riferimento non definito a "awsiotsdk::NetworkConnection::Write(std::string const&, unsigned int&)" ./src/ShadowDelta.o: nella funzione "awsiotsdk::samples::ShadowDelta::InitializeTLS()": /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:119: riferimento non definito a "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" ./src/ShadowDelta.o: nella funzione "awsiotsdk::samples::ShadowDelta::RunSample()": /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:169: riferimento non definito a "awsiotsdk::Utf8String::Create(std::string)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:185: riferimento non definito a "awsiotsdk::Shadow::Shadow(std::shared_ptr<awsiotsdk::MqttClient>, std::chrono::duration<long long, std::ratio<1ll, 1000ll> >, std::string&, std::string&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:197: riferimento non definito a "awsiotsdk::Shadow::AddShadowSubscription(std::map<awsiotsdk::ShadowRequestType, std::function<awsiotsdk::ResponseCode (std::string, awsiotsdk::ShadowRequestType, awsiotsdk::ShadowResponseType, rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&)>, std::less<awsiotsdk::ShadowRequestType>, std::allocator<std::pair<awsiotsdk::ShadowRequestType const, std::function<awsiotsdk::ResponseCode (std::string, awsiotsdk::ShadowRequestType, awsiotsdk::ShadowResponseType, rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&)> > > >&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:228: riferimento non definito a "awsiotsdk::util::JsonParser::InitializeFromJsonString(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&, std::string const&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:230: riferimento non definito a "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:266: riferimento non definito a "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:282: riferimento non definito a "awsiotsdk::util::JsonParser::ToString(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:312: riferimento non definito a "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:329: riferimento non definito a "awsiotsdk::util::JsonParser::ToString(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:334: riferimento non definito a "awsiotsdk::Utf8String::Create(std::string)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:336: riferimento non definito a "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:348: riferimento non definito a "awsiotsdk::util::JsonParser::ToString(rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, rapidjson::CrtAllocator>&)" /home/rasp/eclipse-workspace/testAws/Debug/../src/ShadowDelta.cpp:362: riferimento non definito a "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::thread::_State::~_State()@GLIBCXX_3.4.22" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::erase(unsigned int, unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21" makefile:45: set di istruzioni per l'obiettivo "testAws" non riuscito /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::substr(unsigned int, unsigned int) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::capacity() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::runtime_error::runtime_error(char const*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned int) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char const*, char const*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::rdbuf() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rbegin()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "vtable for std::thread::_State@GLIBCXX_3.4.22" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned int, unsigned int, char const*, unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "typeinfo for std::thread::_State@GLIBCXX_3.4.22" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::data() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(unsigned int, char)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned int, std::allocator<char> const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::collate<char> const& std::use_facet<std::__cxx11::collate<char> >(std::locale const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(unsigned int, char, std::allocator<char> const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert(unsigned int, char const*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::basic_istringstream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::begin()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::end()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned int&, unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::clear()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data(char*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::collate<char>::transform(char const*, char const*) const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char*, char*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(unsigned int, char)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned int)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_local_data()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >)@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rend()@GLIBCXX_3.4.21" /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so: riferimento non definito a "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21"

What is the problem?

Thanks a lot!

Giulio

Hello Giulio,

have to mention that I'm absolute beginner atm but i quess you problem is caused by the stdcxx lib. Have you linked it right?
It also could be a problem if you have different compiler versions (host vs. target) and want to Cross Compile the stdxx lib dynamically. That was my problem when i tried to CC my project for the Beagle Bone Black.

Greetz
Marco

Hello Marco,

thanks a lot for your advise! I changed the compiler version to GCC 6.3.1 so now I'm able to link the std library correctly. Then I had to modify the link command to:

arm-linux-gnueabihf-g++ -L/usr/lib -L/usr/lib/arm-linux-gnueabihf --sysroot=/home/rasp/raspi/sysroot -Wl,-rpath,/home/rasp/raspi/sysroot/usr/local/lib -Wl,-rpath,/home/rasp/raspi/sysroot/lib/arm-linux-gnueabihf -rdynamic /home/rasp/raspi/sysroot/usr/local/lib/libaws-iot-sdk-cpp.so -pthread -o "testAws" ./src/ConfigCommon.o ./src/OpenSSLConnection.o ./src/ShadowDelta.o -lcrypto -lssl -ldl

Now I'm able to compile the sample. But I have a question: I had to add -rpath,/home/rasp/raspi/sysroot/lib/arm-linux-gnueabihf in order to the linker was able to find the libdl.so library. I understand that -rpath option sets the runtime path where the link can find the library. But when I run the executable on Raspberry PI the folder /home/rasp/raspi/sysroot/lib/arm-linux-gnueabihf doesn't exist, but the program runs correctly.

What is the trick?

Thanks a lot!
Giulio

Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.