全部博文(16)
分类: 嵌入式
2010-05-03 19:49:56
我的PC环境
PC:X86
OS:FEDORA 11
TARGET:S3C2410
GNU:arm-linux-gcc 3.4.5
说明:由于QT编译时间较长,所以今天只编译了PC的和基于X86的ARM环境QT,后面将会建立基于ARM的qte。
1.准备源码包
qt-x11-opensource-src-4.5.2.tar.bz2
qt-embedded-linux-opensource-src-4.5.2.tar.bz2
2.安装PC上QT环境
解压源码
[root@PCY-COMPUTER qt]# tar xjvf qt-x11-opensource-src-4.5.2.tar.bz2
进入源码文件夹
[root@PCY-COMPUTER qt]# cd qt-x11-opensource-src-4.5.2
配置
[root@PCY-COMPUTER qt-x11-opensource-src-4.5.2]# ./configure
选择开源,输入o
[root@PCY-COMPUTER qt-x11-opensource-src-4.5.2]# o
接受授权,输入yes
[root@PCY-COMPUTER qt-x11-opensource-src-4.5.2]# yes
编译并安装
[root@PCY-COMPUTER qt-x11-opensource-src-4.5.2]# make;make install
此时需要耐心等待,可能需要2个小时左右。。。
进入该目录
[root@PCY-COMPUTER qt-x11-opensource-src-4.5.2]# cd /usr/local/qt/qt-x11-opensource-src-4.5.2/tools/qvfb/
编译qvfb并安装
[root@PCY-COMPUTER qvfb]# make;make install
查看生成到qvfb文件
[root@PCY-COMPUTER qvfb]# cd ../../../
[root@PCY-COMPUTER qt]# ls
qt-embedded-linux-opensource-src-4.5.2.tar.gz qt-x11-opensource-src-4.5.2 qt-x11-opensource-src-4.5.2.tar.gz
[root@PCY-COMPUTER qt]# file qt-x11-opensource-src-4.5.2/bin/qvfb
qt-x11-opensource-src-4.5.2/bin/qvfb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18,not stripped
到此,PC上面到qt算是安装完毕!
3.配置安装X86的QTE
[root@PCY-COMPUTER src]# ls
qt-embedded-linux-opensource-src-4.5.2.tar.gz qt-x11-opensource-src-4.5.2.tar.gz
[root@PCY-COMPUTER src]# pwd
/usr/local/qt/src
解压源码
[root@PCY-COMPUTER src]# tar xvf qt-embedded-linux-opensource-src-4.5.2.tar.gz -C ../
[root@PCY-COMPUTER src]# cd ..
[root@PCY-COMPUTER qt]# ls
qt-embedded-linux-opensource-src-4.5.2 qt-x11-opensource-src-4.5.2 src
更改目录名,以区别x86和arm版本
[root@PCY-COMPUTER qt]# mv qt-embedded-linux-opensource-src-4.5.2/ qt-embedded-linux-opensource-src-4.5.2-x86
[root@PCY-COMPUTER qt]# ls
qt-embedded-linux-opensource-src-4.5.2-x86 qt-x11-opensource-src-4.5.2 src
[root@PCY-COMPUTER qt]# cd qt-embedded-linux-opensource-src-4.5.2-x86/
配置
[root@PCY-COMPUTER qt-embedded-linux-opensource-src-4.5.2-x86]# ./configure -prefix /usr/local/Trolltech/QtEmbedded-4.5.2-x86 -embedded x86 -qvfb
Which edition of Qt do you want to use ?
Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.
o
This is the Qt for Embedded Linux Open Source Edition.
You are licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.
You are also licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
Type '3' to view the GNU General Public License version 3.
Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.
Do you accept the terms of either license? yes
编译并安装
[root@PCY-COMPUTER qt-embedded-linux-opensource-src-4.5.2-x86]# make;make install
此过程也相对较长,请耐心等待。。。
查看生成到例程文件
[root@PCY-COMPUTER qt]# file /usr/local/Trolltech/QtEmbedded-4.5.2-x86/examples/widgets/analogclock/analogclock/usr/local/Trolltech/QtEmbedded-4.5.2-x86/examples/widgets/analogclock/analogclock: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
复制qfvb
[root@PCY-COMPUTER qt]# cp qt-x11-opensource-src-4.5.2/bin/qvfb /usr/local/Trolltech/QtEmbedded-4.5.2-x86/bin
建立脚本
[root@PCY-COMPUTER qt]# cd /usr/local/Trolltech/QtEmbedded-4.5.2-x86
[root@PCY-COMPUTER QtEmbedded-4.5.2-x86]# vim setenv-x86.sh
添加如下内容
QTEDIR=/usr/local/Trolltech/QtEmbedded-4.5.2-x86
PATH=/usr/local/Trolltech/QtEmbedded-4.5.2-x86/bin:$PATH
LD_LIBRARY_PATH=/usr/local/Trolltech/QtEmbedded-4.5.2-x86/lib:$LD_LIBRARY_PATH
使脚本生效
[root@PCY-COMPUTER QtEmbedded-4.5.2-x86]# source setenv-x86.sh
进入例程
[root@PCY-COMPUTER QtEmbedded-4.5.2-x86]# cd examples/widgets/digitalclock
运行qvfb
[root@PCY-COMPUTER analogclock]# qvfb -width 320 -height 240 &
[root@PCY-COMPUTER analogclock]# QGtkStyle cannot be used together with the GTK_Qt engine.
Qt: Session management error: None of the authentication protocols specified are supported
不晓得这个提示是什么意思,但不影响下一步。。。^_^
运行时钟
[root@PCY-COMPUTER digitalclock]# ./digitalclock -qws
Connected to VFB server :0: 320 x 240 x 32 113x85mm (72x72dpi)