主题 : 友善的工程师帮我看一下 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 8167
精华: 0
发帖: 2
金钱: 70 两
威望: 70 点
综合积分: 4 分
注册时间: 2009-08-12
最后登录: 2009-08-17
楼主  发表于: 2009-08-15 09:23

 友善的工程师帮我看一下

在编译hello程序的时候出现这个,是什么原因?

root@ubuntu:/opt/FriendlyARM/mini2440/arm-qtopia/hello# ./build
rm -f .obj/release-shared/moc_hello_base.o
rm -f .moc/release-shared/moc_hello_base.cpp
rm -f .ui/release-shared/hello_base.cpp .ui/release-shared/hello_base.h
rm -f .obj/release-shared/hello.o .obj/release-shared/main.o .obj/release-shared/hello_base.o
rm -f *~ core *.core
/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic hello_base.ui -o .ui/release-shared/hello_base.h
make: /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/bin/uic:命令未找到
make: *** [.ui/release-shared/hello_base.h] 错误 127
root@ubuntu:/opt/FriendlyARM/mini2440/arm-qtopia/hello#

还有,qtopia编程这块,手册都有错误,在hello程序目录编译qtopia,在qtopia目录里编译hello。
在编译konq什么的时候错误一大堆
你们在这块有没有稍微详细的开发资料,我们新手到这里可就完全傻眼了。
比如那个make从哪里来的,是什么开发工具生成的还是你们手写的?我知道最新的qtopia-core只要qmake就能生成,可是怎么移植能否移植兼容性我就不知道了。
就这些问题。
谢谢!\


后来分步编译,结果如下
make[1]: 正在进入目录 `/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/qmake'
.make[1]:正在离开目录 `/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/qmake'

Creating pngscale...make[1]: 正在进入目录 `/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/util/pngscale'
..make[1]: *** [../../bin/pngscale] 错误 1
make[1]:正在离开目录 `/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/util/pngscale'
Failed to make pngscale

***********************************************************************
*  
*                  ERROR: Building Qtopia has failed.
*  
* Please search the make output for any error messages.
*  
* Hint: If the configuration has changed since the last successfull
* build consider using make clean to ensure that all binaries
* are rebuilt using the new configuration.
*  
* For more information about the build process please use a browser
* and go to the getting started section in:
*     /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/doc/html/index.html
*  
***********************************************************************



是否需要什么工具没装还是什么?
[ 此帖被txgtxg在2009-08-17 09:28重新编辑 ]
级别: 新手上路
UID: 7197
精华: 0
发帖: 21
金钱: 180 两
威望: 151 点
综合积分: 42 分
注册时间: 2009-07-05
最后登录: 2017-09-13
1楼  发表于: 2009-08-15 09:49
build是个shell脚本,如果中途出现什么错误,可以试着分解其中的命令执行。

系统平台:RedHat 9(不一定完全安装,但要装好编程开发工具,这项对于经常做linux应用程序开发的人肯定不会忽略,但X服务器及相关的库,我当时就没装,后来插入cd3补装上)。ubuntu估计也一样的。
交叉编译环境用arm-linux-gcc3.4.1.tar.bz
qt-embedded-2.3.7.tar.gz (qte的库)
qt-x11-2.3.2.tar.gz (为了生成相应的qtdesigner和qvfb)
qtopia-free-1.7.0.tar.gz (qte的桌面环境程序,QPE就是QT PDA应用环境的简称)
tmake-1.11.tar.gz (编译器)
e2fsprogs-1.35.tar.gz (只使用其中的uuid的库)
放在用户登录目录下。

1解压
# cd ~
# mkdir x86-qtopia

# tar zxvf qt-x11-2.3.2.tar.gz
# mv qt-2.3.2 qt-x11

# cd x86-qtopia
# tar zxvf ../tmake-1.11.tar.gz
# tar zxvf ../qt-embedded-2.3.7.tar.gz
# tar zxvf ../qtopia-free-1.7.0.tar.gz
# tar zxvf ../e2fsprogs-1.35.tar.gz
# mv tmake-1.11 tmake
# mv qt-2.3.7/ qt
# mv qtopia-free-1.7.0 qtopia
# mv e2fsprogs-1.35 e2fsprogs

通过上面几步在用户目录中建立如下目录(-->表示内容分就是从后面的文件解压的,只不过重命名了)
qt-x11    -->qt-x11-2.3.2.tar.gz
x86-qtopia
    tmake          -->tmake-1.11.tar.gz
    qt                 -->qt-embedded-2.3.7.tar.gz
    qtopia          -->qtopia-free-1.7.0.tar.gz
    e2fsprogs    -->e2fsprogs-1.35.tar.gz

2编译qt-x11
接下来还必须编译qt-x11,主要是为了编译生成其中的qtdesigner和qvfb。qvfb程序在系统中并未安装,需要我们自己编译。 qtdesigner是和qt库的版本是相关的,当我们使用PC机上和QTE版本不符的qtdesigner时,可能在PC机上的qt-x11能使用的控件在QTE上并未实现,导致应用程序编译不成功。所以,我们使用2.3版本的QTE时,必须使用相同版本的qt-x11编译生成的qtdesigner和 qvfb。
# cd ~/qt-x11
# export QTDIR=$PWD
# echo yes | ./configure -static -no-xft -no-opengl -no-sm
# make -C src/moc
# cp src/moc/moc bin
# make -C src    //我的机子配置是AMD1.74G,内存512M,只开了个虚拟机,这步耗时15分钟
# make -C tools/designer
# make -C tools/qvfb
# cp tools/qvfb/qvfb bin
# strip bin/uic bin/moc bin/designer bin/qvfb
# cp bin/* qt/bin -f
# cp bin/* qt/bin -f

3 PC平台编译环境
编译之前做一下准备工作:打开一个控制台之后设置环境变量。
# cd ~/x86-qtopia
# export QTDIR=$PWD/qt
# export QPEDIR=$PWD/qtopia
# export TMAKEDIR=$PWD/tmake
# export TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g++
# export PATH=$QTDIR/bin:$QPEDIR/bin:$TMAKEDIR/bin:$PATH

3.1 编译QTE
# cd $QTDIR
# cp $QPEDIR/src/qt/qconfig-qpe.h src/tools/ -f
# (echo yes ; echo no) | ./configure -platform linux-generic-g++ -qconfig qpe -depths 16,24,32
# make -C src clean
# make -C src    //耗时起码10分钟
如果成功$QTDIR/lib目录下已经有了qt的库了

3.2 编译QTOPIA
# cd $QPEDIR/src
# ./configure
# make clean
# make    //起码半小时

上面这步如果出现下面错误:
global1.cpp:39:23: uuid/uuid.h: No such file or directory
global1.cpp: In static member function `static QUuid Global::generateUuid()':
global1.cpp:188: `::uuid_generate' undeclared (first use here)
make[1]: *** [.obj/linux-generic-g++//global1.o] Error 1
make[1]: Leaving directory `home/dongjiajing/x86-qtopia/qtopia/src/libraries/qtopia1'
make: *** [libraries/qtopia1] Error 2
表示找不到uuid.h头文件无法编译通过。

进入~/x86-qtopia/e2fsprogs目录下,
#mkdir build
#cd build
#./configure
#make
这步会在./build/lib下产生一些库文件,把./build/lib/uuid/libuuid.a拷到~/x86-qtopia/qtopia /lib下,然后把~/x86-qtopia/e2fsprogs/lib/uuid整个目录(这个目录中含有uuid.h文件)拷到~/x86- qtopia/qtopia/include下,然后返回到$QPEDIR/src中make即可通过。

如果上面都编译通过,则
# cd $QTDIR/bin
# ./qvfb &
#cd $QPEDIR/bin
# ./qpe &
后可以看到qtopia在帧缓冲中显示的桌面环境

以上就完成了在PC上建立arm板的qt模拟开发环境,下面是建立能在arm板上运行qt程序的板载环境。
编译在开发板上运行的qt环境要重新编译qte和qtopia 。编译过程把上面的配置参数由-platform linux-generic-g++改为-platform linux-arm-g++
交叉编译环境用arm-linux-gcc3.4.1.tar.bz,编译时出现文件中变量未声明的错误,友善建议改用arm-linux-gcc3.3.2.tar.bz.
级别: 新手上路
UID: 7366
精华: 0
发帖: 45
金钱: 450 两
威望: 440 点
综合积分: 90 分
注册时间: 2009-07-12
最后登录: 2010-07-15
2楼  发表于: 2009-08-15 10:47

 回 1楼(william_djj) 的帖子

1楼真耐心,赞一个~
级别: 新手上路
UID: 8167
精华: 0
发帖: 2
金钱: 70 两
威望: 70 点
综合积分: 4 分
注册时间: 2009-08-12
最后登录: 2009-08-17
3楼  发表于: 2009-08-15 11:12
谢谢一楼
现在问题是我在使用qtopia-2.2.0,按照友善之臂的手册做的。如果让我再做你的1.7版,再移植到2.2.0上,到时再出两大堆问题就麻烦了。我现在装的是qtopia-core-4.4.3的。能编译qt程序。可是要我把它移植到2.2.0上去,我就不知道怎么做了。
级别: 新手上路
UID: 7197
精华: 0
发帖: 21
金钱: 180 两
威望: 151 点
综合积分: 42 分
注册时间: 2009-07-05
最后登录: 2017-09-13
4楼  发表于: 2009-08-15 17:59

 回 3楼(txgtxg) 的帖子

qtopia2.X.X和桌面qt4.X.X版本差别很大的,最好还是用相同的版本开发。如果要把4.X.X改到2.X.X看来要从改qt程序源码入手了。