How to set up QT compiling environment for a single board computer
How to set up QT compiling environment for a single board computer? Here we take Forlinx
single board computer for example.
Generally, a complete QT compiling environment in Forlinx single board computer cosists of
cross compiler installation and settings, tslib porting, qt porting and qtcreator
installation four parts.Let's learn about it step by step.
1. To install and configure a cross compiler
Users just need extract the compiler pack provided by Forlinx to the appointed path.
The cross compiler has two parts, arm-linux-gcc -v is for kernel compiling and arm-
2009q3.tar.bz2 is for QT compiling. Pls notice that arm-2009q3.tar.bz2 provided by Forlinx
should be 261.9M, if it's smaller than this, pls download a new one from Forlinx.
2.To port TSLIB
Someone may think that it's no need to port tslib if do not touching function, but pls
notice that without tslib, it may occur errors when compiling QT.So it's better for you to
port it no matter whether you need touching function.
Someone may fail to port it or get errors during installation, thus Forlinx provides a
compiled tslib pack named as tslib-sdk.tar.bz2 and users just need extract it to
/usr/local/arm directly.
note: tslib-1.4.tar.bz2 is a pack for source code, and tslib-sdk.tar.bz2 is the compiled
tslib pack.
3. To port QT
Forlinx provides compiled QT to their users. You just need extract qt4.8.5-sdk.tar.bz2 to
/usr/local/arm/, renamed the compiled qmake in /usr/local/arm/qt4.8.5/bin as arm-qmake, and
then copy it to /usr/bin
# cd /usr/local/arm/qt4.8.5/bin
# cp qmake /usr/bin/arm-qmake
# arm-qmake -v
QMake version 2.01a
Using Qt version 4.8.5 in /usr/local/arm/qt4.8.5/lib
Note: qt-everywhere-opensource-src-4.8.5.tar.bz2 is the QT source code pack, and qt4.8.5-
sdk.tar.bz2 is the compiled QT pack
4. to install qtcreator
Execute below command in Ubuntu
#apt-get install qtcreator
after installation, pls input below command in hyper terminal to open QT creator
#qtcreator&
Click as QT Creator-> Tools-> Options and select Build & Run, then click Tools Chains,
click Add to get GCCE, single click Compiler path Browse to add cross compiler
(/usr/local/arm/arm-2009q3/bin/arm-linux-g++) path.
Click Add to get /usr/local/arm/qt4.8.5/bin/qmake and then click Apply to finish
configuration.
At last port the compiled binary file to the board to run. (eg. the generated file is F11)
users just need copy F11 to SD or TF card, and insert the card to board to run
#vi /etc/init.d/qt.sh
in qt.sh, there is the executable binary file Matrix_gui, users just need rename it
accordingly and copy the executable file to /forlinx/qt/bin, then restart the board to get
QT interface.