msgpack / msgpack-c

MessagePack implementation for C and C++ / msgpack.org[C/C++]
Other
3.03k stars 883 forks source link

`sysdep.h` file not found while building the program #1027

Closed marco711 closed 2 years ago

marco711 commented 2 years ago

Hello, I have downloaded and added the library to an existing ESP32C3 project. Nevertheless, when I build it I get the following error message in file zone.h:

../main/msgpack-c/include/msgpack/zone.h:13:10: fatal error: sysdep.h: No such file or directory
 #include "sysdep.h"
          ^~~~~~~~~~

Below the content of my CMakeLists file:

idf_component_register(SRCS "app_main.c" "station.c" "mqtt_communication.c" "i2c_functions.c" "gyroscope.c" "ht_sensor.c" "gpio_functions.c"
                    INCLUDE_DIRS "." "msgpack-c/include")

Is there any path that I must add in order to build the project?

Regards,

Marco

redboltz commented 2 years ago

sysdep.h is generated from https://github.com/msgpack/msgpack-c/blob/c_master/cmake/sysdep.h.in The generation is done at cmake process. If you use msgpack-c from the source then you need to execute cmake.

If you use already installed msgpack-c then you can find sysdep.h in installed directory. If you are not sure the installed directory, then you can find it using find / -name sysdep.h.

marco711 commented 2 years ago

I have just copied the msgpack-c folder into my project and added the include path in the CMakeLists file. Is this the right way to install msgpack-c?

When I run find / -name sysdep.h the permission is denied even if I run as sudo. Is there any instruction I can run to generate the sysdep.h file?

redboltz commented 2 years ago

cmake .

marco711 commented 2 years ago

It generated the header file. Thank you!