当前位置:文档之家› linux下QT的安装

linux下QT的安装

QT的安装


1、拷贝qt-sdk-linux-x86-opensource-2010.05.bin到虚拟机
2、拷贝libstdc++.so.6.0.10文件到虚拟机,放到虚拟机/urs/lib目录下
3、删除usr/lib目录下的libstdc++.so.6,终端输入:#rm /usr/lib/libstdc++.so.6 -rf
4、重建软链接,终端输入:#ln -s /usr/lib/libstdc++.so.6.0.10 /usr/lib/libstdc++.so.6
5、执行#./qt-sdk-linux-x86-opensource-2010.05.bin进行安装
6、默认安装


7、将qt-embedded-linux-src-4.6.3.tar.gz拷贝到虚拟机解压
8、将qscreenlinuxfb_qws.cpp拷贝到解压文件夹的src/gui/embedded/
进行替换

(以下的安装确保已经安装交叉编译器)
9、在qt-everywhere-opensource-src-4.6.3中执行
#./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix /opt/QT/qt-embedded-4.6.3-arm -qt-kbd-tty -qt-mouse-pc -qt-gfx-linuxfb -no-gfx-qvfb -no-gfx-vnc -no-glib -release -shared -no-qt3support -no-xmlpatterns -no-svg -no-webkit -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -make libs -no-nis -no-cups -no-iconv -no-dbus -no-openssl -little-endian -qt-freetype -depths all -qt-mouse-tslib -I /opt/tslib/include -L /opt/tslib/lib

在选项中
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

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


You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
dependencies


This is the Qt for Embedded Linux Open Source Edition.

You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.

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

之后执行
#make
#make install


10、安装freetype-2.4.4.tar.bz2和fontconfig-2.8.0.tar.gz

将freetype-2.4.4.tar.bz2拷贝到虚拟机解压,然后执行
#./configure --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
#make
#make install

将fontconfig-2.8.0.tar.gz拷贝到虚拟机解压,然后执行
#./configure --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
#make
#make install


11、打开软件,配置 Qt Creator
菜单栏选择Tools--Options--Qt4:
选择“加号”添加
Version name:qt-arm-4.6
路径选择qmake locatio

n:/opt/QT/qt-embedded-4.6.3-arm/bin/qmake
然后rebuild、apply、ok确定

./qtapp -qws (QT windows server)




我的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 Les

ser 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)


相关主题
文本预览
相关文档 最新文档