aws/aws-iot-device-sdk-cpp

cross-compile raspberry pi

CubeDevelope opened this issue · 3 comments

Hi,
in Raspberry PI 3 I have cloned the repository and I've compiled and installed it sussefully. Then I syncronized the sysroot into my desktop pc and I try to cross-compile the Shadow example. When I linked the library I received the follow errors:

/home/ubuntu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -std=gnu++11 -fno-exceptions -Wall -Werror ShadowDelta.o ConfigCommon.o OpenSSLConnection.o -o ShadowDelta --sysroot=/home/ubuntu/raspi/sysroot -laws-iot-sdk-cpp -lssl -lcrypto -pthread -ldl

ShadowDelta.o: in function "awsiotsdk::samples::ShadowDelta::InitializeTLS()":
ShadowDelta.cpp:(.text+0x3d8): not define reference to "awsiotsdk::ResponseHelper::ToString(awsiotsdk::ResponseCode)"
ShadowDelta.o: nella funzione "awsiotsdk::samples::ShadowDelta::RunSample()":
ShadowDelta.cpp:(.text+0x6e8):  not define reference to "awsiotsdk::Utf8String::Create(std::string)"...

I'm not able to understand the problem.

Thanks a lot for any advice.

could we get the full build command and output?

Hi Jonathan,
I understand what is the problem, but I'm not able to solve it.

I did a native compile of the library in Raspberry PI 3 correctly. Then I syncronized the sysroot folder, so, on host system I have the sysroot folder where I can find the library in /usr/local/lib and the include file in /usr/local/include folder. When I try to compile a project where I use the library with -L/sysroot/usr/local/lib -laws-iot-sdk I received the errors above.

If I cross-compile the library in host system without copy the files result to Raspberry PI, I'm able to build the project. But If I cross-compile the library and thne copy it to the Raspberry PI, I'm able to build the project but when I try to run on the Raspberry PI I receive the same error.

The problem is the path link when I cross-compile the library. Is there any cross-compile guide for this library?

Thanks a lot!

Giulio

Instructions for compiling on Raspberry Pi can be found here