Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Cross Compiler WiringPi with QT on Linux for RPi3
Hiloshi last edited by Hiloshi
I want to cross compile WiringPi on QT Creator (ubuntu 16.04). I simply add WiringPi directory to header and source as below:
https://www.dropbox.com/s/s6nj9mu33tul6az/Screenshot from 2017-03-05 22-37-35.png
Here are some information about this project:
- Before adding wiringPi, this project can build successful run on Rpi3.
- After adding wiringPi, it shows a lot error.
- I have not add any code to this project(such as "#include "../wiringpi.h").
Any idea is very appreciate.
stryga42 last edited by
Why would you like to cross-compile the WiringPi library? I guess the usual way is to compile WiringPi locally on the Pi, which is quite simple and fast. During cross-compile of your app you just need the header and an additional
LIBS += -lwiringPi
in your pro file. (Assuming proper paths for the system directories of your pi are set in your cross compile environment.)
Check, if you already have WiringPi binaries on your Pi. If yes, you should get something like
pi@raspberrypi:~/deploy $ ldconfig -p | grep wiringPi libwiringPiDev.so (libc6,hard-float) => /usr/local/lib/libwiringPiDev.so libwiringPiDev.so (libc6,hard-float) => /usr/lib/libwiringPiDev.so libwiringPi.so (libc6,hard-float) => /usr/local/lib/libwiringPi.so libwiringPi.so (libc6,hard-float) => /usr/lib/libwiringPi.so
Then make sure, that these libraries are also visible in the Pi root file system on your development machine.