1

When I try to compile I get this error:

fatal error: wiringPi.h: No such file or directory 
#include < wiringPi.h>
                      ^

enter image description here

The code is:

enter image description here

My includes are:

#include < wiringPi.h>
#include < stdio.h>

#define LEDPIN 0 

I have double and triple checked the spelling on everything, and WiringPi is installed. What am I missing?

3

The problem is the space after the <. The system is looking for a file called " wiringPi.h" rather than "wiringPi.h".

I.e. use

#include <wiringPi.h>
#include <stdio.h>
0

The space after < causes problem. #include < wiringPi.h> ==> Wrong #include <wiringPi.h> ==> Correct. Some sample codes at various sites are having this typo error. :-)

-1

As the answer is already given I just want to share that you can use #include if you are using C++ (and not C). It will import all the libraries in the beginning. However, it will give increase the compilation time for the program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.