error of compilation wiringPi.h in visual studio

Viewed 2592

I'm asking for help. I can't compile the app in visual Studio for Windows.

wiringPi.h needed to work with RaspberryPI GPIO (raspberry pi 3b+ worked on ARM)

GIF

https://pp.userapi.com/c849336/v849336202/789a8/2d6RIDT4S28.jpg

https://pp.userapi.com/c849336/v849336202/789ba/tvBF_VF9M5M.jpg

1>H:\ВГУшное облако\OneDrive - ВГУ\Visual studio\BlinkPI\BlinkPI\main.cpp(1,127): error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\Linux\include\wiringPi\2.32\wiringPi.h: No such file or directory 

1>Сборка проекта "BlinkPI.vcxproj" завершена с ошибкой.

or https://pp.userapi.com/c850324/v850324544/341e5/vzb2HHJYT78.jpg

1>H:\ВГУшное облако\OneDrive - ВГУ\Visual studio\BlinkPI\BlinkPI\main.cpp(1,22): error : wiringPi.h: No such file or directory 
1>H:\ВГУшное облако\OneDrive - ВГУ\Visual studio\BlinkPI\BlinkPI\main.cpp(1,22): error :  #include <wiringPi.h> 
1>H:\ВГУшное облако\OneDrive - ВГУ\Visual studio\BlinkPI\BlinkPI\main.cpp(1,22): error :                       ^ 
1>H:\ВГУшное облако\OneDrive - ВГУ\Visual studio\BlinkPI\BlinkPI\main.cpp(1,22): error : compilation terminated.

Thank you in advance

2 Answers

Add "wireingPi.h" to Visual Studio header src Path And Click Apply

I've had the same problem and found a solution here (in German). Basically, the tutorial states to clone the wiringPi.h from git and build it.

Hint: It is not the fault of VisualStudio (see my comment below the answer of Huseyin Meric Yigit), but it is a missing library on the Raspberry Pi.

The commands I typed in the console of the RasPi were (please adapt the paths to your needs):

cd /home/pi
mkdir lib
chmod 0777 lib
cd lib
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core
git clone git://git.drogon.net/wiringPi
git pull origin
./build

Plan to have a coffee while executing the command on line 6 (upgrade). After it is finished, I could successfully compile the project in VisualStudio. Hope, this helps you, too.

Related