A short note on Qt 5.9 Beta cross-compile for Raspberry Pi 3 with Raspbian Jessie

At the time of this writing the cross-compilation of Qt for Raspberry Pi seems to be best described in https://wiki.qt.io/RaspberryPi2EGLFS which was written for version 5.6 of Qt and thus needs to be modified for later Qt versions and the Raspberry Pi 3 board.   To use this guide for version 3 of the Raspberry Pi board the device option "-device  linux-rasp-pi2-g++" in the ./configure command at step 7 needs to be changed to "-device  linux-rasp-pi3-g++" according to the directory listing under .../qtbase/mkspecs/devices/ of the Qt source code directory.   It may also be necessary to add a "-no-use-gold-linker" as described here.   The version of Qt to be compiled may be downloaded over HTTP (i.e. Qt 5.9 Beta) or else using the git command at step 7 with the "-b 5.6" option changed to "-b X.X", where X.X is the version of Qt to clone.

The guide above requires the Raspberry Pi to be connected to the cross-compilation computer to synchronize files, if a direct Ethernet connection is desired the following directions will help.   As an alternative and in the past the suggested way to synchronize files between the cross-compilation computer and the Raspberry Pi was by mounting the Raspberry Pi SD card as described in this well written but otherwise outdated post which also provides more details on how to compile additional Qt modules after the compilation of Qtbase.   Please note that this latter outdated guide does not use the qmake recursive option (i.e. "qmake" instead of "qmake -r") for the compilation of additional modules.

The bytran application requires the following additional modules to be compiled: qtdeclarative,  qtquickcontrols2,  qtquickcontrols (to enable QML, QtQuick, controls and dialogs), and qtsensors (to access cell phone and the Raspberry Pi sensors, see QTBUG-53635, QTBUG-60290, and QTBUG-60309).   To help determine which modules need to be compiled for your application please consult a chart in this post and the listing of Qt modules.

It is also possible to compile all Qt modules at once as suggested here, however in my experience the compilation of all modules was more likely to cause compilation errors like this if one attempts to compile a more recent version of Qt and/or use a newer model of the Raspberry Pi board than those the above guides where written for.   For the above reason it may be easier to compile the Qtbase module first and then only the modules needed to develop your application.   After the cross-compilation is complete, configure the Qt Creator.



www.bytran.org -|- 2017