Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED]Qt cross compile Raspberry Pi
I install Qt on my Raspberry Pi with thi guide "Native Build":http://qt-project.org/wiki/Native_Build_of_Qt5_on_a_Raspberry_Pi. Now i want to compile on Ubuntu 14.04 for the Pi how can i setup my Qt to compile for my Raspberry?
Hi and welcome to devnet,
Do you already have a cross compiler ?
I have no cross compiler.
I had only a Raspberry with installed Qt
Then have a look at the following "guide":http://qt-project.org/wiki/RaspberryPi_Beginners_guide
Now, i have a Problem with this guide.
There is a step to patch qtjsbackend, but i have no such directory after cloning and init the Qt5-repo.
Try using bakeqtpi.bash script from email@example.com:bakeqtpi/yeckels-bakeqtpi.git I've updated the script recently. Do you really need qtjsbackend? You can safely skip this step. Try compiling the base first. You can get back to the modules later, some of them need additional libraries installed on the SD card image.
Now i can compile for the Rapsberry Pi, but some modules are not compiled (qtimageformats, qtjsbackend, qtxmlpatterns, qtsensors, qt3d, qtgraphicaleffects, qtjsondb. Missing or empty directory)
Is it possible to change the target directory on the Raspberry? (Now it is /opt/)
Just go to the directory with module (eg. ~/opt/qtsdk/qtsensors) and run @git checkout@ this should help. However you don't need most of the modules anyway.
If you were using bakeqtpi.bash script than you have two directories
in /usr/local/qt5pi you have files (qmake) for cross-compiling on your Linux machine and in $ROOTFS/usr/local/qt5pi are runtime libraries. Is that what you want?
I mean in Qt after compiling my Project, Qt try to upload the file to /op/... on my Raspberry. Can i change this directory to /home/pi?
Ok, you have some project you are running:
and this install is installing to /opt? Then change target.path = /home/pi/ in your .pro file.
Now all works fine.
Red Baron last edited by
Just an update: qtjsbackend is no more in recent versions due to changes in QML and the fact it uses its own JS engine now instead of V8. As for whether one needs the JS - if you work with QML - YES!