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
搞定