Qt 4.7.3在ARM 2440的移植实例是本文将要讲解的内容,此前反复试过Qt 4.7.0的在ARM上的移植,无奈这个版本的bug甚多,移植非常麻烦,遂坚守4.6.3。
开发板:micro2440 内核:2.6.33.5 arm-linux-g++:4.4.3,经实测,这个版本解决了Segmental Fault的问题。
先在开发板上移植tslib,此处略去。
以下是移植的全过程:
(1)下载qt-everywhere-opensource-src-4.7.3.tar.gz,并解压到/opt/qt473src
(2)mkdir /opt/qt473target,cd /opt/qt473target,vim script,写入如下configure选项(如果想查看Qt在Embedded Linux平台上的configure选项帮助请cd /opt/qt473src,./configure -embedded -h)
../qt473src/configure \
--prefix=/usr/local/qt473lib \
-release -opensource -shared -fast -confirm-license \
-no-largefile \
-no-exceptions \
-no-accessibility \
-no-stl \
-qt-sql-sqlite \
-no-qt3support \
-no-xmlpatterns \
-no-multimedia \
-no-audio-backend \
-no-phonon \
-no-phonon-backend \
-svg \
-no-webkit \
-no-javascript-jit \
-script \
-no-scripttools \
-declarative \
-no-mmx -no-3dnow -no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon \
-qt-zlib \
-qt-gif \
-no-libtiff \
-qt-libpng \
-no-libmng \
-qt-libjpeg \
-no-openssl \
-nomake docs \
-nomake examples \
-nomake tools \
-nomake demos \
-optimized-qmake \
-no-nis \
-no-iconv \
-no-cups \
-no-pch \
-xplatform qws/linux-arm-g++ \
-embedded arm \
-qt-freetype \
-depths 16,18,24 \
-no-opengl \
-qt-gfx-linuxfb -qt-gfx-transformed \
-no-gfx-qvfb -no-gfx-vnc -no-gfx-multiscreen -no-gfx-directfb -no-gfx-qnx \
-no-kbd-linuxinput -no-kbd-tty -no-kbd-qvfb -no-kbd-qnx \
-qt-mouse-tslib \
-no-mouse-pc -no-mouse-linuxtp -no-mouse-linuxinput -no-mouse-qvfb -no-mouse-qnx \
-no-glib
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
在script里写好以上配置后,保存退出,chmod 777 script,./script,开始配置Qt
(3)配置结束后,make make install
(4)完成后,将/usr/local/qt473lib之下的lib和plugin复制到开发板上的相同位置
(5)转入开发板上的/etc,打开profile,加入以下内容
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
export QWS_SIZE=240X320
export QWS_DISPLAY=LinuxFb:mmWidth=50:mmHeight=70:0
export PATH=/usr/local/tslib/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/qt473lib/lib:/usr/local/qt473lib/plugins/imageformats:/usr/local/tslib/lib:/usr/local/libjpeg-turbo/
lib:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=/usr/local/qt473lib/plugins
export QT_QWS_FONTDIR=/usr/local/qt473lib/lib/fonts
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
这些环境变量在Qt的帮助文档中有详细的说明,最后,不要忘了把arm-linux-g++的库文件复制到开发板的/lib下移植过程中遇到的问题:
(1)在开发板上插入usb键盘后,遇到了无法启动Qt程序的问题,进程直接Stopped (tty Output),于是在/etc/profile中去掉了export QWS_KEYBOARD=Linuxinput:/dev/input/event1,在配置中也删去了-qt-kbd-linuxinput,这个问题在Qt 4.6.3中没有遇到过
(2)在运行了基于QWSCalibratedMouseHandler编写的触摸屏校正程序之后,触摸屏失效,于是直接调用Tslib校正触摸屏,这个问题在Qt 4.6.3中也没有遇到过
如果还是遇到了Segmental Fault问题,请参考http://www.friendlyarm.net/forum/topic/1854
小结:详解 Qt 4.7.3在ARM 2440的移植实例的内容介绍完了,希望本文对你有所帮助!更多内容请参考编辑推荐。