This is my first time posting on stack exchange so I apologize if this is too much or not enough info on the problem.

A few months ago I installed Ubuntu Mate 18.04 on a Raspberry Pi 3B+ and tried to compile the blink program found on the wiringPi website. I got the "No such file or directory error" but typing "gpio" in the command line confirmed that wiringPi was installed. Some time later dropped Ubuntu Mate and installed Raspian and there was no such problem - blink.c compiled without a hitch. Now I have switched back to Ubuntu Mate to use ROS and I am having the same old problem with wiringPi not working.

I copied and pasted the code and compilation commands exactly as they are from the wiringPi website so I won't include it here and I know that that should work because it did on Raspbian. I also tried more elaborate compilation commands found in similar problems on stack exchange and elsewhere and got the same error.

I searched through /usr/include and can't find wiringPi anywhere. When I tried to find it with other commands I got a list of files that was to big to read through.

What I would like help with:

  1. I think I need to find the wiringPi.h and .c files and move them to /usr/include directory but I don't have the linux skills to refine my search to what I want.

  2. Could ROS be interfering with gcc?

  3. Shedding some light on why this is happening would be greatly appreciated. I've searched for this problem and tried everything that was suggested in other posts, nothing made a bit of difference.

  4. Should I just try to get along with ROS? The point of taking this wriringPi baby step is not to skip over it when it doesn't work.

  • AFAIK, there will be no wiringPi.h file anywhere on your system unless you've installed wiringPi. If you've installed it on UbuntuMate, then I would guess it got installed wherever UbuntuMate installs header files. Perhaps try using find /usr -name wiringPi.h -type f to help. Also AFAIK, you won't find wiringPi.c (if there is such a thing) anywhere except possibly on the author's website - I seem to recall he didn't publish his source code, but may have done so recently after he decided to deprecate wiringPi.
    – Seamus
    Oct 18, 2020 at 21:08

2 Answers 2


A version of wiringPi is probably installed with Raspbian.

I doubt it is included with Ubuntu.

You will probably need to build from source.

You could try installing the binary from the author's site.


wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb

gpio -v

Make sure it’s version 2.52.

  • Thank you! your link put me on the right track
    – Silas D.
    Oct 20, 2020 at 19:34

Thank you Joan, your answer works for the Pi4 and put me on the write path and everything is compiling as it should! I upvoted your response but I have less than 15 somethings so it doesn't show up.


source: http://wiringpi.com/wiringpi-updated-for-the-pi-v3plus/

cd /tmp
wget https://unicorn.drogon.net/wiringpi-2.46-1.deb
sudo dpkg -i wiringpi-2.46-1.deb

I guess entering gpio and getting all the current activity on the gpio pins does not confirm that wiringPi is installed as it says on the website.

Once again, thank you Joan!

  • 1
    Please mark your's or joan's answer as correct, otherwise, this will pop up for years and years. And those 15 "somethings" are called reputation, or rep for short. Read about it in the help center. Oct 21, 2020 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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