Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Cross Compiler WiringPi with QT on Linux for RPi3

    QtonPi
    2
    2
    1175
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Hiloshi last edited by Hiloshi

      Hi All,

      I want to cross compile WiringPi on QT Creator (ubuntu 16.04). I simply add WiringPi directory to header and source as below:
      Screen
      https://www.dropbox.com/s/s6nj9mu33tul6az/Screenshot from 2017-03-05 22-37-35.png
      Here are some information about this project:

      1. Before adding wiringPi, this project can build successful run on Rpi3.
      2. After adding wiringPi, it shows a lot error.
      3. I have not add any code to this project(such as "#include "../wiringpi.h").

      Any idea is very appreciate.

      1 Reply Last reply Reply Quote 0
      • S
        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post