offsets.h No such file or directory

Hi, 

We have been using SDK version 2.1.1 and currently are in the process of migrating to SDK version 2.5.0.

Would be helpful to get some hint regarding what conditions can lead to the following error when building our application.

In file included from C:\ncs\v2.5.0\zephyr\include\zephyr\app_memory\app_memdomain.h:9,
from C:\ncs\v2.5.0\zephyr\include\zephyr\rtio\rtio.h:31,
from C:\ncs\v2.5.0\zephyr\include\zephyr\drivers\i2c.h:28,
from <our application.h>...
C:\ncs\v2.5.0\zephyr\include\zephyr\linker\linker-defs.h:26:10: fatal error: offsets.h: No such file or directory
26 | #include <offsets.h>
| ^~~~~~~~~~~

Thanks,

Mathi.

Parents
  • This one irritated me long enough to find a fix myself. Details over on Zephyr's GitHub, but basically:

    This is due to source files you add to the project via add_subdirectory not picking up the pre-build dependencies correctly. So ninja helpfully starts building everything at once, in parallel, intermittently bombing out when the pre-build output files haven't yet appeared. Only randomness comes to the rescue, eventually producing the output files before they're required for input.

    The solution is to add add_dependencies(LIBRARY_NAME, offsets_h) to your CMakeLists.txt file.

    The library name is generated by the CMakeLists.txt file that includes the source files, using zephy_library() and friends. The Zephyr naming convention is derived from the path, like drivers__input__input_gpio_keys. But for out-of-tree drivers you'll have to check what name has been given - you should be able to make it out from the build command above the "fatal error" message.

Reply
  • This one irritated me long enough to find a fix myself. Details over on Zephyr's GitHub, but basically:

    This is due to source files you add to the project via add_subdirectory not picking up the pre-build dependencies correctly. So ninja helpfully starts building everything at once, in parallel, intermittently bombing out when the pre-build output files haven't yet appeared. Only randomness comes to the rescue, eventually producing the output files before they're required for input.

    The solution is to add add_dependencies(LIBRARY_NAME, offsets_h) to your CMakeLists.txt file.

    The library name is generated by the CMakeLists.txt file that includes the source files, using zephy_library() and friends. The Zephyr naming convention is derived from the path, like drivers__input__input_gpio_keys. But for out-of-tree drivers you'll have to check what name has been given - you should be able to make it out from the build command above the "fatal error" message.

Children
No Data
Related