Operating system: Ubuntu 11.04
Cross-compilation tool chain and its path: arm-none-linux-gnueabi/usr/local/arm/4.3.2
Source: qt-everywhere-opensource-src-4.7.3.tar.gz
Porting process:
1 Download source code, decompression, into the decompression folder:
#tar ZXVF qt-everywhere-opensource-src-4.7.3.tar.gz
#cd qt-everywhere-opensource-src-4.7.3
2 Configuring QT
./configure-opensource-confirm-license-release-shared-embedded Arm-xplatform qws/linux-arm-g++-depths 4,8,16,18,24,32-fast-optimized-qmake-qt-sql-sqlite-qt-libjpeg-qt-zlib-qt-libpng-qt-freetype-little-endian- Host-little-endian-no-qt3support-no-libtiff-no-libmng-no-opengl-no-mmx-no-sse-no-sse2-no-3dnow-no-openssl- No-webkit-no-qvfb-no-phonon-no-nis-no-cups-no-glib-no-xcursor-no-xfixes-no-xrandr-no-xrender- No-separate-debug-info-nomake examples-nomake tools-nomake Docs qt-mouse-tslib I/usr/local/tslib/include-l/usr/loca L/tslib/lib
Error occurred:
The Tslib functionality Test failed!
.....
Tried solutions:
(1) Reinstall Tslib correctly
(2) Change ... /qt-everywhere-opensource-src-4.7.3/mkspecs/qws/linux-arm-g++/qmake.conf files, adding:
QMAKE_CC = Arm-linux-gcc-lts
Qmake_cxx = arm-linux-g++-lts
Qmake_link = arm-linux-g++-lts
Qmake_link_shlib = arm-linux-g++-lts
Or the same problem ...
(3) Problem solving .... It turned out to be a cross compilation tool chain Setup problem and reset the environment:
Open/ROOT/.BASHRC
Last line Add export path= $PATH:/usr/local/arm/4.3.2/bin
3 Make
Problem occurs:
/work/qt-everywhere-opensource-src-4.7.3/src/tools/bootstrap/libbootstrap.a:could not read symbols:file in wrong Format
Collect2:ld returned 1 exit status
MAKE[1]: * * * * [...] /.. /.. /BIN/MOC] Error 1
MAKE[1]: Leaving directory '/work/qt-everywhere-opensource-src-4.7.3/src/tools/moc '
Make: * * * [sub-moc-make_default-ordered] Error 2
The reason is not to delete the previous configuration,
Make Confclean
Make Distclean
Then Configure,make,make install in turn.
4 when the installation is complete, the/usr/local/trolltech/qtembedded-4.7.3-arm folder is generated by default, and if you want to change the installation path, such as installing in the/USR/LCOAL/QT folder, configure add-prefix/ USR/LCOAL/QT parameter. Next to the file and Tslib folder into the root file system, originally wanted to use a U disk copy past, but U disk File system and Linux ext2 incompatible, so you can only consider using NFS root file system. Before the configuration has not been successful, and then tried the next even can, hehe. So I put the Trolltech and tslib two folders directly into the NFS root file system in the Virtual machine folder. Then you compile a QT project to see if you can run it correctly on the Development Board.
5 Development Board Environment settings, OK6410 NFS root file System Bin directory has a Qt4 script file, for setting environment variables and running programs, we just change a few lines of content can run their own QT program:
#!/bin/sh
Base1=qpe
Pid= '/bin/pidof $base 1 '
If [-N "$pid"]; Then
Killall $base 1
Fi
Base2=qss
Pid= '/bin/pidof $base 2 '
If [-N "$pid"]; Then
Killall $base 2
Fi
Base3=quicklauncher
Pid= '/bin/pidof $base 3 '
If [-N "$pid"]; Then
Killall $base 3
Fi
Base4=fluidlauncher
Pid= '/bin/pidof $base 4 '
If [-N "$pid"]; Then
Killall $base 4
Fi
Export Tslib_root=/usr/local/tslib
Export Tslib_tsdevice=/dev/input/event2
Export tslib_tseventtype=h3600
Export tslib_conffile=/usr/local/tslib/etc/ts.conf
Export Tslib_plugindir=/usr/local/tslib/lib/ts
Export tslib_calibfile=/etc/pointercal
Export tslib_plugindir= $TSLIB _root/lib/ts
Export Tslib_consoledevice=none
Export tslib_fbdevice=/dev/fb0
Export Qtdir=/usr/local/trolltech/qtembedded-4.7.3-arm
Export ld_library_path= $QTDIR/plugins/qtopialmigrate/: $QTDIR/qt_plugins/imageformats/: $QTDIR/lib:/root/tslib/ Build/lib: $LD _library_path
Export Path=/bin:/sbin:/usr/bin/:/usr/sbin:/root/tslib/build/bin
if [-c/dev/input/event2]; Then
Export qws_mouse_proto= "Tslib:${tslib_tsdevice}"
If [-e/etc/pointercal-a!-s/etc/pointercal]; Then
Rm/etc/pointercal
/root/tslib/build/bin/ts_calibrate
Fi
Else
Export qws_mouse_proto= "Mouseman:/dev/input/mice"
>/etc/pointercal
Fi
Export Qws_keyboard=tty:/dev/tty1
fb_size=$ (Cat/sys/class/graphics/fb0/virtual_size)
#export qws_display= "Linuxfb:mmwidth76:mmheight44:1"
Case "$FB _size" in
800,480)
Export qws_display= "Linuxfb:mmwidth91:mmheight53:1"
;;
480,272)
Export qws_display= "Linuxfb:mmwidth76:mmheight44:1"
;;
*)
Export qws_display= "Linuxfb:mmwidth91:mmheight53:1"
;;
Esac
#export qws_display=:1
Export Home=/root/qte4home
Cd/bin
./hello-qws
The places I have changed are:
Export Qtdir=/usr/local/trolltech/qtembedded-4.7.3-arm
Last two lines:
Cd/bin
./hello-qws
Hello is the executable file I got when I cross-compile on PC Linux and put it under the Bin folder.
The program runs correctly on the development Board, haha.
Cross-compilation of 6 routines hello.
Build the Hello project with Qt-creator, then compile and generate pro engineering files. Execute the/usr/local/trolltech/qtembedded-4.7.3-arm/bin/qmake under the Engineering folder, generate the makefile file, and make the executable file Hello, Copy Hello to the Developer Board Bin folder.