qt4环境搭建-fedora9----------------------------------------

本文详细介绍了如何使用Qt Creator和Qt libraries在不同平台上构建和运行应用程序,包括PC版本、嵌入式x86版本和嵌入式arm版本的Qt库构建与运行步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://qt.nokia.com/downloads
下载 Qt CreatorQt libraries(qt library以qt-everywhere-opensource-src-4.6.3.tar.gz为例)
1.编译pc版本的qt library,即编译生成的.so后.a可以运行在pc即桌面x86的fedora下
解压qt-everywhere-opensource-src-4.6.3.tar.gz到某个目录,tar xvzf ...进入执行
#./configure
# gmake
# gmake install
之后会在/usr/local/Trolltech/出现Qt-4.6.3
用qtcreator 创建一个app如test并使用此库build之后,点击run可以直接运行。当然也可以直接在test所在目录执行./test去运行之。
2.编译嵌入式x86版本的qt library,即编译生成的.so和.a可以运行在嵌入式x86的linux下--这个没必要编译的。
解压qt-everywhere-opensource-src-4.6.3.tar.gz到另外一个目录,进入执行
# ./configure -embedded x86 -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb
# gmake
# gmake install
之后会在/usr/local/Trolltech/出现QtEmbedded-4.6.3
用qtcreator创建一个app如test并使用此库build之后,在fedora上不可以直接运行即点击run不起作用,但用qvfb模拟一下就可以了。如下
首先运行qvfb,
# /usr/local/Trolltech/QtEmbedded-4.6.3/bin/qvfb  -width 800 -height 480
然后在qtcreator中的project页中的run setting的Arguments项里填上-qws,然后点击run就可以运行了是在qvfb里面模拟运行。当然也可以在如./test  -qws去运行

3.编译嵌入式arm版本的qt library,即编译生成的.so和.a可以运行在arm cpu的linux下如mini440
解压qt-everywhere-opensource-src-4.6.3.tar.gz到另外一个目录,进入执行
#./configure -prefix /usr/local/Trolltech/QtEmbedded-4.6.3-arm -opensource -confirm-license -debug-and-release -shared -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -qt-gfx-transformed -fast -optimized-qmake -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-phonon -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake demos -nomake tools -nomake docs -qt-kbd-tty -qt-kbd-linuxinput -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-qvfb -qt-mouse-tslib
# gmake
# gmake install
如果想编译出静态的库将-shared换成-static
用qtcreator创建一个app并使用此库build之后,但在板子上的下面的操作一定不要少:
为支持触摸屏,开机自动设置环境变量,在mini2440的 /etc/profile中追加:
否则程序在板子上面运行时出现错误:
error while loading shared libraries: libts-0.0.so.0: cannot open shared object file: No such file or directory

export LD_LIBRARY_PATH=/usr/local/lib:$QTDIR/lib:$LD_LIBRARY_PATH                                                  
export TSLIB_ROOT=/usr/local/lib     
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_FBDEVICE=/dev/fb0  
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export POINTERCAL_FILE=/etc/pointercal
export TSLIB_CALIBFILE=/etc/pointercal
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
重启执行./test -qws



refer to
http://www.arm9home.net/read.php?tid-5161.html
http://www.arm9home.net/read.php?tid-5182.html
http://www.arm9home.net/read.php?tid-9223.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值