1.下載源碼qts4.6.4,分別解壓三份,qt-x11,x86-qte,arm-qte
2.cd arm-qte/mkspec/qws/linux-arm-g++/
vi qmake.conf
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
加上lts後,在編譯時間應用程式時就不會出現ld: warning: libts-0.0.so.0, needed by /home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so,
not found (try using -rpath or -rpath-link)/home/zhxt/qt_for_arm/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read_raw'
這樣的問題
3.進入arm464-qte/src/gui/itemviews/qabstractitemview.cpp第2311行,將'Key_BackSpace' 更改為將'Key_Backspace'
避免出現itemviews/qabstractitemview.cpp:2311: error: 'Key_BackSpace' is not a member of 'Qt'這樣的問題
4.配置
./configure -prefix /usr/local/arm481 -release -opensource -shared -fast -no-largefile -qt-sql-sqlite -no-exceptions -stl -no-qt3support -no-webkit -no-mmx -no-3dnow -no-sse -no-sse2 -no-svg -qt-libpng -qt-libjpeg -make libs -nomake examples -nomake docs -nomake
demo -no-nis -no-cups -no-iconv -no-dbus -no-openssl -xplatform qws/linux-arm-g++ -embedded arm -little-endian -host-little-endian -qt-freetype -depths 8,16,24 -qt-gfx-linuxfb -no-gfx-vnc -no-gfx-qvfb -no-gfx-transformed -no-gfx-multiscreen -qt-mouse-tslib
-I/usr/local/tslib/include -L/usr/local/tslib/lib -no-glib
如果選上了-webkit會出Package gstreamer-app-0.10 not found的錯誤。
5.gmake
gmake install
6.進入x86-qte
./configure ......-qt-mouse-qvfb -qt-gfx-qvfb -qt-kbd-qvfb -embedded x86 -xplatform qws/linux-x86-g++...去掉有關tslib的
gmake
gmake install
7.進入x11-qt
./configure -no-webkit -qvfb
gmake
gmake install
8. cd x11-qt/tools/qvfb
make
make install
如果出現X11/extensions/XTest.h:沒有那個檔案或目錄這樣的錯誤
redhat enterprise 6要安裝libXtst-1.0.99.2-3.el6.i686.rpm這個包
ubuntu執行命令:sudo apt-get install xorg-dev
搞定