Storage size of 'timespec' isn't known - CMake

70 views Asked by At

I am trying to compile the openSafety-mqtt project (https://github.com/hasiflo/openSafety_mqtt) by hasiflo. After installing all necessary libraries, I am now able to build one of the Safety Nodes (sn1) by using the following command:

cmake -S openSafety_mqtt/ -B opensafety_toolchain/build/ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TARGET="sn1"

This works since no errors are popping up. When trying to make the program, for which I use the following command:

make -C opensafety_toolchain/build sn1

It starts building the project but gives a error. This is the error: storage of size "l_clockTime" isn't known. struct timespec l_clocktime.

This obviously has something to do the timespec struct, however I have tried multiple solutions (adding the _POSIX_C_SOURCE in both the command and the code itself), the problem seems not to get away.

At this moment I am pretty much stuck on this. I am out of options and do not know how to build the project without the error since this piece of code is necessary. I am building the project in a VM with debian 12 OS. It should be possible to make it work. Can someone help me out?

0

There are 0 answers