-
Notifications
You must be signed in to change notification settings - Fork 736
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
Can't compile with CMake - umock_c_prod.h: no such file or directory #2654
Comments
Important update: I noticed that the problem arises when trying to compile my # snippet
set(main_files
main.cpp
azure-helpers.cpp # <---- HERE
)
add_executable(${PROJECT_NAME} ${main_files})
target_include_directories(${PROJECT_NAME} PUBLIC azure-iot-sdk-c/provisioning_client/inc) # <---- ADDED and remove everything in my Note that, upon successful compilation, i can use my IDE to see that the previously not found header is #these are the include folders
#the following "set" statetement exports across the project a global variable called UMOCK_C_INC_FOLDER that expands to whatever needs to included when using umock_c library
set(UMOCK_C_INC_FOLDER ${CMAKE_CURRENT_LIST_DIR}/inc CACHE INTERNAL "this is what needs to be included if using umock_c lib" FORCE) so setting instead in my project # AFTER including the Azure IoT C SDK!
target_include_directories(azure-helpers PUBLIC ${UMOCK_C_INC_FOLDER}) changed the error message to
Following the same research, in the relevant CMake file I found #these are the include folders
#the following "set" statement exports across the project a global variable called MACRO_UTILS_INC_FOLDER that expands to whatever needs to included when using macro_utils
set(MACRO_UTILS_INC_FOLDER ${CMAKE_CURRENT_LIST_DIR}/inc CACHE INTERNAL "this is what needs to be included if using macro utils" FORCE) and finally, adding # again after adding the Azure SDK
target_include_directories(azure-helpers PUBLIC ${MACRO_UTILS_INC_FOLDER}) I can compile the project. A quick search with |
Hi all, thank you for your work. I know this has been noticed before (#2436 #1364 #1086) but apparently the proposed solutions did not fix the problem for me.
Platform: Ubuntu 22.04
SDK submodule:
7afef615156a74aa2a0393506bff04ec215e4c11 azure-iot-sdk-c (2018-03-07-temp-pod-1460-g7afef6151)
I am trying to integrate the IoTHub provisioning (with x509) into our application. I want to adapt the code I found in
provisioning_client/samples/prov_dev_client_ll_x509_sample/prov_dev_client_ll_x509_sample.c
, but since I'd like to not have everything into a single file, I tried creating a separate {cpp/hpp} couple of files, calledazure-helpers
that will contain the Azure connection logic (both provisioning and MQTT telemetry). However, it fails by telling me during compilation:What can I do to make it find the right header? Thanks!
MWE
CMakeLists.txt
:main.cpp
:azure-helpers.cpp
:include/azure-helpers.hpp
:The text was updated successfully, but these errors were encountered: