Stddef.h not found

Hello everyone,

when i make px4_fmu-v5_default or make px4_sitl_default, it show me a fatal error, which is

/usr/include/string.h:33:10: fatal error: stddef.h: no file or not directory
#include <stddef.h>

Could any one knows how should i fix it, pls?

Where are you building this?
It sound like there is something wrong with your include paths in your build environment.

Hi, Thx, I just build it at ~/src/Firmware. I have no idea about the include paths.
What the terminal shows seems something wrong about nuttx. Or maybe just the path error because /usr/include/string.h it exists. So could you pls tell me how should i do?

FAILED: NuttX/nuttx/include/nuttx/config.h NuttX/nuttx/include/nuttx/version.h
cd /home/sique/src/Firmware/build/px4_fmu-v5_default/external/Build/px4io_firmware/NuttX/nuttx && make --quiet --no-print-directory CONFIG_ARCH_BOARD_CUSTOM=y pass1dep > nuttx_context.log
In file included from mkconfig.c:40:0:
/usr/include/string.h:33:10: fatal error: stddef.h: no such file or directory
#include <stddef.h>
compilation terminated.
In file included from cfgdefine.c:40:0:
/usr/include/string.h:33:10: fatal error: stddef.h: no such file or directory
#include <stddef.h>
compilation terminated.
make[2]: *** [mkconfig] Error 1
make[1]: *** [tools/mkconfig] Error 2
ninja: build stopped: subcommand failed.

I can’t say about your include paths, but I can tell you this - it found string.h which in turn included stddef.h which it could not find.
If you plan to develop C++ code you will need to learn about include paths. If you have no idea about include paths you need to do a bit of research.
Also you may made a error somewhere in the set up for the dev environment - all too easy to do.
use ‘find’ to find where stddef.h is then add that directory to your include path is one idea.
Expect to have to do this often - it’s just the way C/C++ is.