詳解 Qt 4.7.3在ARM 2440的移植實(shí)例
Qt 4.7.3在ARM 2440的移植實(shí)例是本文將要講解的內(nèi)容,此前反復(fù)試過Qt 4.7.0的在ARM上的移植,無奈這個(gè)版本的bug甚多,移植非常麻煩,遂堅(jiān)守4.6.3。
開發(fā)板:micro2440 內(nèi)核:2.6.33.5 arm-linux-g++:4.4.3,經(jīng)實(shí)測(cè),這個(gè)版本解決了Segmental Fault的問題。
先在開發(fā)板上移植tslib,此處略去。
以下是移植的全過程:
(1)下載qt-everywhere-opensource-src-4.7.3.tar.gz,并解壓到/opt/qt473src
(2)mkdir /opt/qt473target,cd /opt/qt473target,vim script,寫入如下configure選項(xiàng)(如果想查看Qt在Embedded Linux平臺(tái)上的configure選項(xiàng)幫助請(qǐng)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
在script里寫好以上配置后,保存退出,chmod 777 script,./script,開始配置Qt
(3)配置結(jié)束后,make make install
(4)完成后,將/usr/local/qt473lib之下的lib和plugin復(fù)制到開發(fā)板上的相同位置
(5)轉(zhuǎn)入開發(fā)板上的/etc,打開profile,加入以下內(nèi)容
- 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
這些環(huán)境變量在Qt的幫助文檔中有詳細(xì)的說明,最后,不要忘了把a(bǔ)rm-linux-g++的庫文件復(fù)制到開發(fā)板的/lib下移植過程中遇到的問題:
(1)在開發(fā)板上插入usb鍵盤后,遇到了無法啟動(dòng)Qt程序的問題,進(jìn)程直接Stopped (tty Output),于是在/etc/profile中去掉了export QWS_KEYBOARD=Linuxinput:/dev/input/event1,在配置中也刪去了-qt-kbd-linuxinput,這個(gè)問題在Qt 4.6.3中沒有遇到過
(2)在運(yùn)行了基于QWSCalibratedMouseHandler編寫的觸摸屏校正程序之后,觸摸屏失效,于是直接調(diào)用Tslib校正觸摸屏,這個(gè)問題在Qt 4.6.3中也沒有遇到過
如果還是遇到了Segmental Fault問題,請(qǐng)參考http://www.friendlyarm.net/forum/topic/1854
小結(jié):詳解 Qt 4.7.3在ARM 2440的移植實(shí)例的內(nèi)容介紹完了,希望本文對(duì)你有所幫助!更多內(nèi)容請(qǐng)參考編輯推薦。