[SOLVED] How to install QT under the Raspbian image?

  • i executed apt-get install qt50-snapshot
    but where can i find the configure-script?
    and what does sysroot mean?

  • Which configure script? qt50-snapshot installs only Qt libs, include files & qmake with tools... You do not need to configure and build Qt on your raspbian... just use qmake to generate Makefile for your project and build it.

    Sysroot - is system root folder tree of your system, it is only needed if you want buld Qt by yourself.

    What you actually need?

    1. Just build programs with Qt on your RPi? qt50-snapshot should be installed on your RPi.
    2. Build program with Qt on your Local PC for RPi? You then need cross-compiler, sysroot and cross-compiled Qt on your Local PC and installed qt50-snapshot on your RPi
    3. Build Qt for RPi? you then need cross-compiler and sysroot on your Local PC

    There is pretty nice articles on the wiki for all kind of situations: "Qt 5 and Raspberry Pi":http://qt-project.org/wiki/Qt-RaspberryPi

  • If I use the second option: is it enough to say apt-get install qt50-snapshot or do I have to do additional actions to install the snapshot?

  • yes. installed qt50-snapshot on RPi is enough to run program cross-compiled on your Local PC.
    Just follow this "tutorial":http://qt-project.org/wiki/Create#QtonPi_App_SDK to cross-compile your app.

  • But after installing the snapshot on the pi, cross-compiling the hello-world-app and deploying it I get the messagelib

    error while loading shared libraries : QtQuick.so.5: cannot open shared object file: No such file or directory

    do I have to do more than to say apt-get install qt50-snapshot?

  • Look into the /opt/ path, can you see "vt" & "qt5" folder? Look into the /opt/qt5/lib which libraries are installed. You should have /opt/qt5/lib/libQtQuick.so.5 there.
    If Qt libs are installed correctly, but you still can't deploy and run your app, check with ldd(on the RPi) if all dependency for your app are found. just run:
    ldd /path/to/your/hello-qtonpi

    you can also check if all dependency for Qt is there:
    readelf -d /opt/qt5/lib/libQtCore.so.5.0.0
    readelf -d /opt/qt5/lib/libQtQuick.so.5.0.0

  • There is no qt5 or vt in my opt-folder

  • ldd says : not a dynamic executable

    the readelf commands seem to work even if the folder is /opt/qt50-snapshot/lib. does this matter?

  • do I have to use special settings in the pro file or otherwere in the project?

  • Is it possible that I have to use another qmake to cross-compile for the wheezy than for the original qtonpi image?

  • can be solved by

    export LD_LIBRARY_PATH=/opt/qt50-snaphot/lib

    before running the qt-program.

  • I ran into the same problem, but in my case it comes from a custom QT5 build (not the snapshot).
    Anyway, if followed http://qt-project.org/wiki/RaspberryPi_Beginners_Guide
    and qt ended being installed not in opt but in /usr/local/qt5pi/
    libQtQuick.so.5.0.0 is in the lib subfolder but setting LD_LIBRARY_PATH does not change anything which is quite surprising, and as for Pinkypanzer the ldd tells me hello-qtonpi is not an executable :(

    Any other clue?

  • where did you execute it? via QtCreator or locally on the pi?
    do you have the rights to execute it?

  • Both give the same result: running from QtCreator and running locally give the same error message

    Yes, my binaries are in 644 mode

  • now I see there's an error in my post. it has to be
    export LD_LIBRARY_PATH=/opt/qt50-snapshot/lib
    maybe this is your problem? you have to link the lib-folder

  • Indeed I've done that, but qt is not installed in opt for me, it is in /usr/local/qt5pi/lib !
    And obviously I did not picked up the path, it came out of the box from the guidelines :(

  • in QT CREATOR you have to set the the path in the system environment

    cited from the beginners guide:
    At last, add the LD_LIBRARY_PATH on the “System Environment” and set it to “/usr/local/qt5pi/lib”

    In my case the path would be "/opt/qt50-snapshot/lib"

  • Then I'm sorry, I don't know what your problem is.
    Did you check the path is available at you pi and you have the rights to read from it?

  • @jcverdie

    I followed the beginners guide like yourself also and ran into the same problem.

    Apps deployed and executed from within QtCreator ran correctly on the device but if I went to the command line on the RPi itself, I couldn't execute them (libQtQuick.. not found)

    Running: export LD_LIBRARY_PATH=/usr/local/qt5pi/lib/

    Fixes this problem but only when logged in as root!

    If I export LD_LIBRARY_PATH as user 'pi' I still cannot execute the binary (same error as before).

    Stranger still, QtCreator which can deploy and run the binary correctly, is logging in via ssh with user 'pi' !

    Any ideas why this is happening?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.