Error on c++ examples

Hi…Im trying to compile the examples of c++ but whener I write “make” I get the following error:

g++ -std=gnu++11 -I …/… …/…/Navio/gpio.cpp …/…/Navio/RGBled.cpp …/…/Navio/Util.cpp LED.cpp -o LED
In file included from …/…/Navio/gpio.cpp:1:0:
/usr/include/unistd.h:226:20: fatal error: stddef.h: No such file or directory
#include <stddef.h>
^
compilation terminated.
In file included from …/…/Navio/RGBled.h:4:0,
from …/…/Navio/RGBled.cpp:1:
/usr/include/stdio.h:33:21: fatal error: stddef.h: No such file or directory

include <stddef.h>

                 ^

compilation terminated.
…/…/Navio/Util.cpp:1:18: fatal error: cstdio: No such file or directory
#include
^
compilation terminated.
In file included from …/…/Navio/RGBled.h:4:0,
from LED.cpp:1:
/usr/include/stdio.h:33:21: fatal error: stddef.h: No such file or directory

include <stddef.h>

                 ^

compilation terminated.
Makefile:7: recipe for target ‘all’ failed
make: *** [all] Error 1

The code compile fine on my ubuntu, just when I try to compile it on the navio2 i get this mistake…
Anyway, what is the matter? do I have to install something? make up some path? my g++ version:
g++ (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
Copyright © 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

EDIT: python examples works fine. Just c++ that is having issues

First of all, please use Navio 2 examples rather than Navio examples.

hi sorry, I wrote it wrong, it was Navio2 examples that I tried. The following error message is for the LED.cpp when I hit make on Navio2/C++/Examples/LED2

@asura
I just made a fresh install and issues these commands:

git clone git@github.com:emlid/Navio2.git
cd Navio2/C++/Examples/
make

No errors whatsoever. Is there a chance you somehow deleted some system C headers? The easiest option would be to make a fresh install.

I see, ok. I will try it soon and update this topic. This is totally possible though, I did a lot of weird stuff when I was trying to install the px4 haha so some important stuff might have been changed. Thank you for the feedback.

Hi, just want to write up a conclusion for this. I did a fresh install and indeed it worked. Thank you for the assistance! I probably did something wrong when I was installing the px4 on my first try.

1 Like