Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iothub_client_sample_mqtt_dm sample generates unsafe header/library path used in cross-compilation error #2543

Closed
licensedslacker opened this issue Nov 27, 2023 · 1 comment
Labels

Comments

@licensedslacker
Copy link

Development Machine, OS, Compiler (and Other Relevant Toolchain Info)

Ubuntu 22.04 on WSL2
Cross Compiled using GCC 12.3 (buildroot based cross compiler)

SDK Version (Please Give Commit SHA if Manually Compiling)

master
1.10.1
1.11.0

Protocol

MQTT

Describe the Bug

iothub_client_sample_mqtt_dm sample generates error while cross-compiling because of the include path "-I/usr/include/azureiot"

The actual error message is: "ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include/azureiot'"

The path is set in the sample's CMakeLists.txt file:

set(AZUREIOT_INC_FOLDER "pi_device" "../../../serializer/inc" "." "/usr/include/azureiot" "/usr/include/azureiot/inc")
include_directories(${AZUREIOT_INC_FOLDER})

CMake project configured with the command cmake -S . -B corss_build -G Ninja --toolchain custom-toolchain.cmake -DCMAKE_BUILD_TYPE=Release -Duse_http=off -Dskip_samples=off

MCVE

Console Logs

@licensedslacker
Copy link
Author

After giving a second thought for this, I think it's not very common use case to cross compile samples. Samples might be tested on the host system rather than in the target system. Using -Dskip_samples=on parameter for CMake might the desired way to get the libraries for the target system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant