Skip to content

Cross compiling Qt5

Aleksandar Atanasov edited this page Aug 21, 2015 · 4 revisions

TODO

Download sources from http://download.qt.io/archive/qt/{DESIRED_QT5_MAJOR_RELEASE_VERSION}/{DESIRED_QT5_MINOR_RELEASE_SUBVERSION}/single/qt-everywhere-opensource-src-{DESIRED_QT5_VERSION_MAJOR_AND_MINOR_RELEASE}.tar.gz

Warning! Do NOT download the ZIP file. I did that for Qt5.3.2 and 4.8.2 and discovered that the configuration files are "damanged" by DOS line endings leading to being unable to configure the build unless you use a tool such as dos2linux in order to conver all this garbage to Unix-conform line endings

Native Build guide: https://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi

--> Since we have Raspberry Pi 2 change the device accordingly (remember the qmake.conf and qplatformdefs.h?) ./configure -v -opengl es2 -device linux-rasp-pi2-g''+ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5 &> output

Cross-compiling for Qt5: https://blog.qt.io/blog/2012/04/13/cross-compiling-qt-for-the-masses/

I use the CrossToolChains for Debian hence I add /usr/bin/arm-linux-gnueabihf- to the cross-compile flag

-device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-