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

2019-07-12 18:23发布

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