下载qt-x11-opensource-src-4.5.2.tar.gz
下载 地址:===>> http://down1.chinaunix.net/distfiles/ qt -x11-opensource-src-4.5.2.tar.bz2
进入你的文件夹后解压 qt-x11-opensource-src-4.5.2.tar.gz
tar jxvf qt-x11-opensource-src-4.5.2.tar.gz
进入解压后的文件夹/qt-x11-opensource-src-4.5.2
开始配置安装
./configure -no-openssl //出现选项时都输入 yes
make
===>>make的时间很久,你可以做其他事
2.安装 qt / e
下载qt -embedded-free-3.3.8.tar.bz2
下载 地址:===>> http://down1.chinaunix.net/distfiles/ qt -embedded-free-3.3.8.tar.bz2
(已经有新版本了: qt -embedded-linux-opensource-src-4.5.3
下载 地址:
ftp://ftp.trolltech.com/ qt /source/ qt -embedded-linux-opensource-src-4.5.3.tar.gz)
./configure -no-openssl -qvfb -depths 4,8,16,32
yes
make
3。安装qvfb
1.进入qvfb源码目录:
# cd /home/src/qt-x11-opensource-src-4.5.2/tools/qvfb
2.执行qmake生成pro工程:
# /home/src/qt-x11-opensource-src-4.5.2/bin/qmake -project
3.执行qmake生成Makefile
# /home/src/qt-x11-opensource-src-4.5.2/bin/qmake
4.编译make
# make
错误:
qvfb.cpp:771: 错误:‘DeviceSkinParameters’ 在此作用域中尚未声明
qvfb.cpp:771: 错误:expected `;'' before ‘parameters’
qvfb.cpp:773: 错误:‘parameters’ 在此作用域中尚未声明
qvfb.cpp:773: 错误:‘DeviceSkinParameters’ is not a class or namespace
make: *** [.obj/release-shared/qvfb.o] 错误 1
解决方法:
qvfb.cpp:47:24: 错误:deviceskin.h:没有那个文件或目录
一般差头文件会导致cpp文件中很多数据结构和常量没有定义。找到头文件deviceskin.h在qt-x11-opensource-src-4.5.2/tools/shared/deviceskin/下面。拷贝到qvfb文件夹下。
再编译:
.obj/release-shared/x11keyfaker.o:/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:459: more undefined references to `XTestFakeKeyEvent'' follow
.obj/release-shared/x11keyfaker.o: In function `X11KeyFaker::connect()'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:544: undefined reference to `XTestQueryExtension''
collect2: ld 返回 1
make: *** [qvfb] 错误 1
能看出来有两个方面的错误,一个是DeviceSkinParameters类的函数连接,另一个XTestFakeKeyEvent函数的问题。
解决办法是:
1.复制deviceskin.h,deviceskin.cpp到qvfb文件下。
2.在qvfb文件夹下手动生成qvfb工程。(例:/home/2410sQt/host/qt-4.5.2/bin/qmake -project))
3.qmake;
4.vi Makefile 修改Makefile 中 LIBS 选项: 添加 -lXtst选项。
再编译有错误-lXtst not commond
解决办法 :
yum install libxtst-dev
重新编译 make文件生成后LIBS 选项: 添加 -lXtst选项。
我出现如下错误
[root@jswinter qvfb]#: qvfb & //试运行qvfb
[1] 13827
[root@jswinter qvfb]# qvfb: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
解决方法:结果证明事路径的问题,我重新export下路径,界面出来了