When cross-compiling, usually prepare mkspec, refer to: Http://wiki.qt.io/Building_Qt_for_Embedded_Linux
Mkspec consists of two files:
- Qmake.conf-this is a list of qmake variable assignments this tells Qmake what flags to pass through to the compiler, whic h compiler to use etc.
- Qplatformdefs.h-this is a header file with various platform-specific #includes and #defines. Often This just refers to a existing Qplatformdefs.h file from another generic Mkspec.
Reference http://doc.qt.io/qt-5/embedded-linux.html
As you can see, QT has prepared mkspec for pi2, and we only need to specify it when compiling the configuration.
./configure-release-opengl es2-device linux-rasp-pi2-g++-device-option cross_compile= $TOOLCHAIN/arm-bcm2708/ gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf--sysroot $ROOTFS-prefix/usr/local/qt5- Fontconfig-eglfs
Ubuntu raspy Pi2 compiled QT5 library