[V1] SDK cross compile error
ToolChain setting:toolchain-imx6.cmake INCLUDE(CMakeForceCompiler) SET(CMAKE_SYSTEM_NAME Linux) # this one is important SET(CMAKE_SYSTEM_VERSION 1) # this one not so much
this is the location of the imx6 toolchain targeting the IS
SET(CMAKE_C_COMPILER /opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc) SET(CMAKE_CXX_COMPILER /opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++)
this is the file system root of the target
SET(CMAKE_FIND_ROOT_PATH /work/Digital/JinWeiChen/imx6)
search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
complie command: ./build.sh --toolchain-file toolchain-imx6.cmake
compile error:
Scanning dependencies of target iothub_client_amqp_transport
[ 39%] Building C object iothub_client/CMakeFiles/iothub_client_amqp_transport.dir/src/version.c.o
[ 39%] Building C object iothub_client/CMakeFiles/iothub_client_amqp_transport.dir/src/iothub_client_authorization.c.o
[ 40%] Building C object iothub_client/CMakeFiles/iothub_client_amqp_transport.dir/src/iothub_message.c.o
[ 41%] Building C object uamqp/CMakeFiles/uamqp.dir/src/amqp_frame_codec.c.o
[ 41%] Building C object iothub_client/CMakeFiles/iothub_client_amqp_transport.dir/src/iothub_client_ll.c.o
[ 42%] Building C object uamqp/CMakeFiles/uamqp.dir/src/amqp_management.c.o
In file included from /work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/c-utility/inc/azure_c_shared_utility/umock_c_prod.h:23:0,
from /work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/c-utility/inc/azure_c_shared_utility/gballoc.h:7,
from /work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/iothub_client/src/iothub_client_ll.c:7:
/work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/iothub_client/src/iothub_client_ll.c:47:21: error: unknown type name 'IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT'
DEFINE_ENUM_STRINGS(IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT_VALUES);
^
/work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/c-utility/inc/azure_c_shared_utility/macro_utils.h:12582:34: note: in definition of macro 'DEFINE_ENUM_STRINGS'
const char* C2(enumName,Strings)(enumName value)
^
/work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/iothub_client/src/iothub_client_ll.c:47:21: error: unknown type name 'IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT'
DEFINE_ENUM_STRINGS(IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT_VALUES);
^
/work/Digital/JinWeiChen/remote_upgrate/azure-iot-sdk-c-1/c-utility/inc/azure_c_shared_utility/macro_utils.h:12594:57: note: in definition of macro 'DEFINE_ENUM_STRINGS'
int C2(enumName, _FromString)(const char* enumAsString, enumName* destination)
^
make[2]: *** [iothub_client/CMakeFiles/iothub_client_amqp_transport.dir/src/iothub_client_ll.c.o] 错误 1
make[1]: *** [iothub_client/CMakeFiles/iothub_client_amqp_transport.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
Hello @jinweichen
Do you know what version of gcc this compiler is based from? This looks like an issue we saw with older versions of gcc.
Hi @jinweichen can you provide the details of which version of sdk you are working on i am able to compile with out any issue