congia
Posts: 15
Joined: Sat Feb 02, 2013 3:23 am

wiringPi.h not found

Fri Jan 03, 2014 3:27 am

Hi, I just installed Wiring Pi and typing "gpio" confirmed it installed fine.

I'm trying to compile blink.c with

Code: Select all

gcc -Wall -o blink blink.c -lwiringPi
(http://wiringpi.com/examples/blink/) and I'm getting

Code: Select all

blink.c:1:22: fatal error: wiringpi.h: No such file or directory
I ran the find command and got:

Code: Select all

sudo find / -name wiringPi.h
/home/pi/WiringPi2-Python/WiringPi/wiringPi/wiringPi.h
/home/pi/wiringPi/wiringPi/wiringPi.h
/usr/local/include/wiringPi.h
/usr/include/wiringPi.h
wiringPi.h is already included in the default include folder but it isn't getting picked up by GCC. How can I fix this problem?

Thanks

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: wiringPi.h not found

Fri Jan 03, 2014 8:09 am

Use the -L option of gcc to add the path to the required file (see its man page or got to http://linux.die.net/man/1/gcc). Alternatively you could also define LIBRARY_PATH such that there was a common search list for all your software development.

congia
Posts: 15
Joined: Sat Feb 02, 2013 3:23 am

Re: wiringPi.h not found

Fri Jan 03, 2014 2:31 pm

DBryant wrote:Use the -L option of gcc to add the path to the required file (see its man page or got to http://linux.die.net/man/1/gcc). Alternatively you could also define LIBRARY_PATH such that there was a common search list for all your software development.
Definitely gonna look at those. I found my problem though, it was pretty stupid actually. I was missing the capital 'P' in 'wiringPi'. Thank you for your reply.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: wiringPi.h not found

Fri Jan 03, 2014 11:54 pm

Have you run

Code: Select all

sudo -i
cd wiringPi # the directory where you downloaded it
./build
exit
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

congia
Posts: 15
Joined: Sat Feb 02, 2013 3:23 am

Re: wiringPi.h not found

Sat Jan 04, 2014 12:02 am

Hey, it was my stupidity. I didn't capitalise the P in wiringPi.h. Everything is working fine now. Thanks for the help.

Return to “Beginners”