Chinaunix首页 | 论坛 | 博客
  • 博客访问: 532779
  • 博文数量: 150
  • 博客积分: 5010
  • 博客等级: 大校
  • 技术积分: 1861
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-17 00:19
文章分类

全部博文(150)

文章存档

2011年(1)

2009年(14)

2008年(135)

我的朋友

分类: LINUX

2008-04-20 00:19:06

参照下面的文章把qt-x11-2.3.2装上了qembed工具,这是把图像转为.c的工具。昨晚上装只是在基其文件夹下make,出错,找不到qte库等,其实是环境变量的问题 ,没有这样的思维:它是在qt-2.3.2的文件夹下,就应该像装qvfb一样装。看了这个文章才醒。
====================
 Install Qt/X11
        编译qt-x11-2.3.2并非是用来开发,而是Virtual为了产生编译qtopia必须的库以及用于在图形环境下进行调试的qvfb(Qt Virtual Frame Buffer)。
        这里安装qtopia时只要编译qt-2.3.2,是为了使用qt-2.3.2生成的uic,所以要用gcc/g++编译,不要用arm-linux-gcc/g++编译。
# cd /pxa255
# tar zxvf qt-x11-2.3.2.tar.gz
# cd qt-2.3.2/
# vi configs/linux-g++-shared  修改语句
    SYSCONF_CXXFLAGS_X11= -I/usr/include/freetype2

 export QTDIR=$PWD
# export PATH=$PWD/bin:$PATH
# export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
# ./configure –no-xft               
# make
# make -C tools/qvfb/  像它一样装上,用 make -C tools/qembed
# cp tools/qvfb/qvfb bin/
# ./bin/qvfb &        x11-FrameBuffer就运行起来了
# cp bin/uic $QPEDIR/bin/
# cp bin/uic $QTEDIR/bin/


=========================
5、Qt/Embedded 的安装
准备以下源码包和文件(在GEC2440 光碟的Linux 源码包/gui 目录下找到)
tmake-1.11.tar.gz
qt-embedded-2.3.7.tar.gz
qt-x11-2.3.2.tar.gz
qconfig-local.h
qtopia-free-1.7.0.tar.bz2
假设源码包放在/home/build_qte/目录下
#cd /home/build_qte/
5.1 tmake 的安装
解压tmake 源码包
#tar zxvf tmake-1.11.tar.gz
进入解压目录
#cd tmake-1.11
建立shell 文件,在文件中添加如下内容
#vi env.sh
export TMAKEDIR=$PWD
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++
export PATH=$TMAKEDIR/bin:$PATH
保存退出.
添加环境变量
#source env.sh
5.2 Qt X11 的安装
你可能需要root 帐号,这取决于你要安装Qt 的路径的权限。从TrollTech 公司的官方
ftp 站点获得qt-x11-2.3.2.tar.gz 软件包。解开和解压缩软件包:
# tar -vxzf qt-x11-2.3.2.tar.gz
进入解开后的文件,设置一些环境变量
# cd qt-x11-2.3.2
# vi env.sh
export QTDIR=$PWD
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
#source env.sh
在配置之前,我们先看一下配置的选项:
#./configure –help
主要的配置信息如下:
The defaults (*) are usually acceptable. Here is a short explanation of each option:
* -release ........... Compile and link Qt with debugging turned off.
-debug ............. Compile and link Qt with debugging turned on.
* -shared ............ Create and use a shared Qt library (libqt.so)
-static ............ Create and use a static Qt library (libqt.a)
* -no-gif ............ Do not compile in GIF reading support.
-gif ............... Compile in GIF reading support. See src/kernel/qgif.h
-no-sm ............. Do not support X Session Management.
* -sm ................ Support X Session Management, links in -lSM -lICE.
* -no-thread ......... Do not compile with Threading Support
-thread ............ Compile with Threading Support
* -qt-zlib ........... Use the zlib bundled with Qt. –system
-zlib ....... Use a zlib from the operating system

* -qt-libpng ......... Use the libpng bundled with Qt.
-system-libpng ..... Use a libpng from the operating system. See

* -no-mng ............ Do not compile in MNG I/O support.
-system-libmng ..... Use libmng from the operating system.See 
* -no-jpeg ........... Do not compile in JPEG I/O support.
-system-jpeg ....... Use jpeglib from the operating system.See 
* -no-nas-sound ...... Do not compile in NAS sound support.
-system-nas-sound .. Use NAS libaudio from the operating system.see

-no- ....... Disables a module, where module can
can be one of: opengl table network canvas
-kde ............... Builds the Qt Designer with KDE 2 support, so that
KDE 2 widgets can be used directly in the Qt Designer.
$KDEDIR must be set to point to a KDE 2 installation.
See 
-no-g++-exceptions . Disable exceptions on platforms using the GNU C++compiler by
using the -fno-exceptions flag.
-no-xft ............ Disable support for Anti-Aliased fonts through the
Xft extension library (XFree86 4.0.2 and newer).
-xft ............... Enable support for Anti-Aliased fonts.
Xft support is auto-detected, but you may use these
flags to explicitly enable/disable support.
-platform target ... The platform you are building on (linux-g++)
-xplatform target .. The platform when cross-compiling.
See the PLATFORMS file for a list of supported
operating systems and compilers.
-Istring ........... Add an explicit include path.
-Lstring ........... Add an explicit library path.
-Rstring ........... Add an explicit dynamic library runtime search path.
嵌入式ARM9-2440实战手册
第 288 页,共 343 页
-lstring ........... Add an explicit library.
Qt/Embedded only:
-qconfig local ..... Use src/tools/qconfig-local.h rather than the default (qconfig.h).
-depths list ....... Comma-separated list of supported bit-per-pixel depths, from: v, 4, 8, 16, 24, and 32. 'v' is
VGA16.
-accel-voodoo3 ..... Enable Voodoo3 acceleration.
-accel-mach64 ...... Enable Mach64 acceleration.
-accel-matrox ...... Enable Matrox MGA acceleration.
-qvfb .............. Enable X11-based Qt Virtual Frame Buffer.
-vnc ............... Enable VNC server (requires network module).
选择我们需要的配置和平台:
#./configure -no-xft -no-opengl
按照下面的选择进行一步一步,并且会有以下打印信息:
Type 'Q' to view the Q Public License.
Type 'G' to view the GNU General Public License.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.
Do you accept the terms of the license?
yes
This target is using the GNU C++ compiler (linux-g++).
Recent versions of this compiler automatically include
code for exceptions, which increase both the size of
the Qt library and the amount of memory taken by your
applications.
You may elect to re-run ./configure with the
-no-g++-exceptions
option to compile Qt without exceptions. This is
completely binary compatible, and existing
applications will continue to work (like KDE 2).
Build type: linux-g++-shared
Thread support..................... yes
GIF support........................ yes
MNG support........................ no
JPEG support....................... yes
OpenGL support .................... yes
NAS sound support.................. no
Session management................. yes
Xft support (Anti-Aliased Fonts) .. no
XKB support ....................... yes
Creating makefiles...
Qt is now configured for building. Just run make.
To reconfigure, run make clean and configure.
生成Makefile 后,就可以进行安装
#make
嵌入式ARM9-2440实战手册
第 289 页,共 343 页
安装成功后,将会有以下打印信息:
The Qt library is now built in ./lib
The Qt examples are built in the directories in ./examples
The Qt tutorials are built in the directories in ./tutorial
Note: be sure to set $QTDIR to point to here or to wherever
you move these directories.
Enjoy! - the Trolltech team
编译生成qvfb、qembed工具
#make -C tools/qvfb
#make -C tools/qembed
5.3 Qt/Embedded 安装
解开软件包:
#tar zxvf qt-embedded-2.3.7.tar.gz
进入软件包中并设置一些环境变量:
#cd qt-2.3.7
#export PATH=/usr/local/arm/3.3.2/bin:$PATH
#export QTDIR=$PWD
#export QTEDIR=$QTDIR
在qconfig_local.h 文件中添加一行:
#define QT_QWS_IPAQ_RAW
拷贝该文件到相应目录
#cp /qconfig-local.h src/tools/
#cp qt-2.3.2/bin/uic ./bin
如果是交叉编译,设置编译选项:
#./configure -xplatform linux-arm-g++ -shared -qconfig local -qvfb -depths 4,8,16,32 –gif
–system-jpeg
如果不是交叉编译,想在qvfb 上运行的话,那么则去掉“xplatform linux-arm-g++”选项
即可;
生成Makefile 之后,就可以进行编译了:
#make
5.4 交叉编译qtopia
如果已经安装好了qt-embedded,就可以进行Qtopia 的安装了.
解压源码包
#tar zxvf qtopia-free-1.7.0.tar.gz
设置环境变量:
#export QTDIR=$QTEDIR
#export QPEDIR=$PWD
#export PATH=$QPEDIR/bin/:$PATH
接下来就可以配置了:
嵌入式ARM9-2440实战手册
第 290 页,共 343 页
#cd src/
#./configure -platform linux-arm-g++
如果是在qvfb 上运行的话,则为:
#./configure -platform linux-x86-g++
生成Makefile 之后,就可以进行编译了:
#make
阅读(1858) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~