近几天在搞QT4.8.5移植到ARM中,这里记录一下遇到的一些问题。
对于支持触摸屏,内核也是有要求的,与Android是不一样的,具体的可以参考:http://blog.csdn.net/orz415678659/article/details/9136575
另外这里对tslib做了支持,如果是第一次编译tslib,那么可能会出现一个错误,可参考这里:http://blog.csdn.net/wang_shuai_ww/article/details/45895389
首先配置是:
./configure -prefix /wsh_space/my_install/QT/Trolltech/QtEmbedded-4.8.5-arm -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-webkit -qt-libtiff -qt-libmng -no-mouse-pc -no-mouse-qvfb -no-mouse-linuxtp -no-mouse-qnx -qt-mouse-linuxinput -qt-gfx-transformed -no-neon -qt-gfx-linuxfb -qt-libjpeg -qt-libpng -little-endian -qt-mouse-tslib -nomake examples -nomake demos -nomake docs -I./tslib1.4/include -L./tslib1.4/lib我这里没有编译tools、example、demos,以加快编译速度。
这里需要修改一个文件/mkspecs/qws/linux-arm-g++/qmake.conf,主要是修改编译器:
# modifications to g++.conf QMAKE_CC = arm-cortex_a9-linux-gnueabi-gcc QMAKE_CXX = arm-cortex_a9-linux-gnueabi-g++ QMAKE_LINK = arm-cortex_a9-linux-gnueabi-g++ QMAKE_LINK_SHLIB = arm-cortex_a9-linux-gnueabi-g++ # modifications to linux.conf QMAKE_AR = arm-cortex_a9-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-cortex_a9-linux-gnueabi-objcopy QMAKE_STRIP = arm-cortex_a9-linux-gnueabi-strip
The specified system/compiler is not supported
对于上面的错误,可以参考这里http://blog.csdn.net/lf8289/article/details/8349493
编译,我这里没有遇到错误,如果遇到错误,大家可以百度,基本都能够解决。
可是最后测试的时候问题来了。我的QT配置如下
export set QTDIR=/usr/local/Trolltech/QtEmbedded-4.8.5-arm export set QPEDIR=/usr/local/Trolltech/QtEmbedded-4.8.5-arm export set LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH #export set QWS_MOUSE_PROTO="Tslib:/dev/input/event1" #export set QWS_MOUSE_PROTO="Intellimouse:/dev/input/mice" export set QWS_MOUSE_PROTO="LinuxInput:/dev/input/event1 IntelliMouse:/dev/input/mice" #export QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mice; #export QWS_MOUSE_PROTO=LinuxInput:/dev/input/event1:$QWS_MOUSE_PROTO; export set QWS_SIZE="1024x600" export set QWS_KEYBOARD="LinuxInput:/dev/input/event1" #export set QWS_DISPLAY="LinuxFb:mmWidth600:mmHeight480:0" export set QWS_DISPLAY="LinuxFB:/dev/fb0" export set QT_QWS_FONTDIR=$QTDIR/lib/fonts export set QT_PLUGIN_PATH=$QTDIR/plugins/ export PATH=$QTDIR/bin:$PATH
后来就换成了下面的配置,问题解决:
./configure -prefix /wsh_space/my_install/QT/Trolltech/QtEmbedded-4.8.5-arm -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-webkit -qt-libtiff -qt-libmng -qt-mouse-tslib -qt-mouse-linuxinput -qt-mouse-pc -qt-gfx-transformed -no-neon -qt-gfx-linuxfb -qt-libjpeg -qt-libpng -little-endian -no-mouse-linuxtp -no-pch -nomake tools -nomake examples -nomake demos -nomake docs -I./tslib1.4/include -L./tslib1.4/lib