QT4移植文档

  • 格式:doc
  • 大小:43.50 KB
  • 文档页数:5

前提要成移植tslib1.4之后。

Qt:qt-everywhere-opensource-src-4.6.2.tar.gz

嵌入式平台:2410

arm-linux-gcc:3.4.1

1、 在/work下面建立QT4文件夹。

2、 将qt-everywhere-opensource-src-4.6.2.tar.gz放在QT4下解压。

3、 进入qt-everywhere-opensource-src-4.6.2文件夹。

4、 ./configure -prefix /usr/local/QtEmbedded-4.6.2-arm -opensource -confirm-license -release

-shared -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -fast

-optimized-qmake -no-pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype

-little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx

-no-sse -no-sse2 -no-3dnow -no-openssl -no-webkit -no-qvfb -no-phonon -no-nis -no-opengl

-no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info

-nomake examples -nomake tools -nomake docs -qt-mouse-tslib -I/usr/local/tslib/include

-L/usr/local/tslib/lib -D__ARM_ARCH_5TEJ__

5、 gmake

可能出现以下错误

第一种错误:

/home/lijian/QT/source/qt-everywhere-opensource-src-4.6.2/src/gui/text/qfontengine_ft.cpp: In member function `bool QFontEngineFT::init(QFontEngine::FaceId, bool,

QFontEngineFT::GlyphFormat)':

/home/lijian/QT/source/qt-everywhere-opensource-src-4.6.2/src/gui/text/qfontengine_ft.cpp:696: warning: converting to `int' from `qreal'

{standard input}: Assembler messages:

{standard input}:778: Error: register or shift expression expected -- `orr

r3,r2,lsl#16'

{standard input}:789: Error: register or shift expression expected -- `orr

r2,r3,lsl#16'

{standard input}:7748: Error: register or shift expression expected -- `orr

r3,r0,lsl#16'

{standard input}:7761: Error: register or shift expression expected -- `orr

r1,r0,lsl#16'

make[1]: *** [.obj/release-shared-emb-arm/qfontengine_ft.o] 错误 1

make[1]: Leaving directory

`/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/src/gui' make: *** [sub-gui-make_default-ordered] 错误 2

解决办法:

修改src/3rdparty/freetype/include/freetype/config/ftconfig.h文件的第330行:

"orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */

修改为:

"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */

第二种错误:

这个错误发生在最后编译example和demo的过程中,如果在configure的时候取消了example,则可以跳过。

/home/.usr_local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: warning: libts-0.0.so.0, needed by

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so, not found (try

using -rpath or -rpath-link)

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so: undefined

reference to `ts_close'

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so: undefined

reference to `ts_config'

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so: undefined

reference to `ts_read'

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so: undefined

reference to `ts_read_raw'

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so: undefined

reference to `ts_open'

/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/lib/libQtGui.so: undefined

reference to `ts_fd'

collect2: ld returned 1 exit status

make[3]: *** [animatedtiles] 错误 1 make[3]: Leaving directory

`/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/examples/animation/animatedtiles'

make[2]: *** [sub-animatedtiles-make_default] 错误 2

make[2]: Leaving directory

`/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/examples/animation'

make[1]: *** [sub-animation-make_default] 错误 2

make[1]: Leaving directory

`/home/lijian/QT/build/3.4.1gcc/qt-embedded-4.6.2/examples'

make: *** [sub-examples-make_default-ordered] 错误 2

解决:

修改mkspecs/qws/linux-arm-g++/qmake.conf

QMAKE_LINK = arm-linux-g++ -lts

QMAKE_LINK_SHLIB = arm-linux-g++ -lts

6、 gmake install

7、 在/work/rootfile/rootfs/etc/profile里面添加

export QTDIR=/usr/

export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

export PATH=$QTDIR/qt_bin:$QTDIR/bin:$PATH

export QWS_MOUSE_PROTO='TSLIB:/dev/event0'

export QWS_SIZE=320x240

export QWS_MOUSE_PROTO=Tslib:/dev/event0

export QT_QWS_FONTDIR=/usr/lib/fonts

export QWS_DISPLAY="LinuxFb:mmWidth100:mmHeight130:0"

8、 在PC机根目录下建立gedit arm.sh 文件,添加 QTEDIR=/usr/local/QtEmbedded-4.6.2-arm

PATH=/usr/local/QtEmbedded-4.6.2-arm/bin:$PATH

LD_LIBRARY_PATH=/usr/local/QtEmbedded-4.6.2-arm/lib:$LD_LIBRARY_PATH

CPLUS_INCLUDE_PATH=/usr/local/arm/3.4.5/include/c++:$CPLUS_INCLUDE_PATH

9、 把/usr/local/QtEmbedded-4.6.2-arm/lib中除了pkgconfig文件外的所有文件拷贝到/work/rootfile/rootfs/usr/lib中

10、 下面就可以测试一下看是否移植成功,把/usr/local/QtEmbedded-4.6.2-arm/

demos/mainwindow中mainwindow文件拷贝到开发板,cp mainwindow

/work/rootfile/rootfs/

11、 启动开发板

执行./mainwindow –qws ,会出现缺少相应的库文件,找到相应的文件考到开发板中就可以了[root@localhost ~]cd

/usr/local/QtEmbedded-4.6.2-arm/demos/embedded/digiflip

[root@localhost digiflip]# cp

/usr/local/arm/3.4.1/arm-linux/lib/libstdc++.so.6

/work/rootfile/rootfs/rootfs/lib