• «
  • 1
  • 2
  • »
  • Pages: 1/2     Go
主题 : 编译ARM平台的Qtopia ,编译Hello,make出错,求助!? 复制链接 | 浏览器收藏 | 打印
怎么成高级会员?
级别: 新手上路
UID: 5450
精华: 0
发帖: 22
金钱: 220 两
威望: 220 点
综合积分: 44 分
注册时间: 2009-04-23
最后登录: 2009-06-30
楼主  发表于: 2009-05-03 17:03

 编译ARM平台的Qtopia ,编译Hello,make出错,求助!?

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2009-09-10)
先前出现make: *** No rule to make target `/opt/FriendlyARM/QQ2440/arm-qtopia/qtopia/include/qtopia/qpeapplication.h', needed by `main.o'.  Stop.错误
我解决了
是hello的makefile文件有问题是
/opt/FriendlyARM/qq2440/arm-qtopia/qtopia/include/qtopia/qpeapplication.h \改为
/opt/FriendlyARM/mini2440/arm-qtopia/qtopia/include/qtopia/qpeapplication.h \
但又出现新问题
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x164): undefined reference to `QWidget::imComposeEvent(QIMEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x168): undefined reference to `QWidget::imEndEvent(QIMEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x16c): undefined reference to `QWidget::tabletEvent(QTabletEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x170): undefined reference to `QWidget::dragEnterEvent(QDragEnterEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x174): undefined reference to `QWidget::dragMoveEvent(QDragMoveEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x178): undefined reference to `QWidget::dragLeaveEvent(QDragLeaveEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x17c): undefined reference to `QWidget::dropEvent(QDropEvent*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1a8): undefined reference to `QWidget::windowActivationChange(bool)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1b0): undefined reference to `QWidget::create(unsigned long, bool, bool)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1c8): undefined reference to `QWidget::setMicroFocusHint(int, int, int, int, bool, QFont*)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1e4): undefined reference to `QPaintDevice::setResolution(int)'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1e8): undefined reference to `QPaintDevice::resolution() const'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1f0): undefined reference to `non-virtual thunk [nv:-40] to QWidget::scanLine(int) const'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1f4): undefined reference to `non-virtual thunk [nv:-40] to QWidget::bytesPerLine() const'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x1f8): undefined reference to `non-virtual thunk [nv:-40] to QWidget::graphicsContext(bool) const'
moc_hello_base.o(.gnu.linkonce.r._ZTV13HelloBaseForm+0x200): undefined reference to `non-virtual thunk [nv:-40] to QWidget::metric(int) const'
collect2: ld returned 1 exit status
make: *** [/opt/FriendlyARM/mini2440/arm-qtopia/qtopia/bin/hello] Error 1
估计是哪个头文件没包含进去,但具体不大清楚,请高手帮忙下!?

我build等上面配置都没报错,而且每一步都运行了,就这出错。
不知道是我没配置好,还是makefile 不行。
(资料都是公司给的)
学习arm版
这个阶段正是我事业的上升期,我怎么能走得开呢?
级别: 精灵王
UID: 3197
精华: 3
发帖: 770
金钱: 6995 两
威望: 5398 点
综合积分: 1600 分
注册时间: 2008-12-30
最后登录: 2010-12-31
1楼  发表于: 2009-05-03 21:47
正确的步骤:
1. build-all
这样可以生成qtopia基本库
2. .set-env
如果单独编译hello, 一定要运行它,以设置环境变量,这样才能找到上一步中的基本库
3. 进入hello执行make
怎么成高级会员?
级别: 新手上路
UID: 5450
精华: 0
发帖: 22
金钱: 220 两
威望: 220 点
综合积分: 44 分
注册时间: 2009-04-23
最后登录: 2009-06-30
2楼  发表于: 2009-05-03 23:12

 回 1楼(26672624) 的帖子

我都按说明书上说了,你说的,我都执行了,但应然有错误。我把我的Makefile给你传下,有空帮我看看,或者你给我传个用过的,编译通过的。小弟在此拜谢了~~
学习arm版
怎么成高级会员?
级别: 新手上路
UID: 5450
精华: 0
发帖: 22
金钱: 220 两
威望: 220 点
综合积分: 44 分
注册时间: 2009-04-23
最后登录: 2009-06-30
3楼  发表于: 2009-05-03 23:14

 回 1楼(26672624) 的帖子

这是我Hello 里面的Makefile
附件: Makefile.rar (2 K) 下载次数:15
学习arm版
这个阶段正是我事业的上升期,我怎么能走得开呢?
级别: 精灵王
UID: 3197
精华: 3
发帖: 770
金钱: 6995 两
威望: 5398 点
综合积分: 1600 分
注册时间: 2008-12-30
最后登录: 2010-12-31
4楼  发表于: 2009-05-04 11:41
如果使用最新版的Qtopia系统,要编译hello执行的命令是build,而不是make
build会根据目录里的pro文件自动生成makefile然后再编译。
怎么成高级会员?
级别: 新手上路
UID: 5450
精华: 0
发帖: 22
金钱: 220 两
威望: 220 点
综合积分: 44 分
注册时间: 2009-04-23
最后登录: 2009-06-30
5楼  发表于: 2009-05-06 22:35

 回 4楼(26672624) 的帖子

我用最新版的Qtopia系统,是编译成功,也生成了hello可执行文件,但下到板子上,不能用,给我报说:“Could not locate application hello",hello文件找不到。
我一个同学用扬创公司出的版和资料,编了一个hello可执行文件,那个可以在我们的板上执行。我们的hello 不能在他们板上运行。不知道为什么?(注:chmod 我加了)
我用旧版本编的那个依然报那错,还没解决,大哥给支个招吧~~
学习arm版
这个阶段正是我事业的上升期,我怎么能走得开呢?
级别: 精灵王
UID: 3197
精华: 3
发帖: 770
金钱: 6995 两
威望: 5398 点
综合积分: 1600 分
注册时间: 2008-12-30
最后登录: 2010-12-31
6楼  发表于: 2009-05-07 09:05
新版本编译出来的hello必须在新版的文件系统上才能使用,千万不能混用以前的。
扬创的qtopia全部资料都是抄袭友善的,你用它编译出来的hello在mini上能够运行,是因为你开发板里面装的系统还是老系统。
或者这样说:
你编译出来的hello是基于qtopia-2.2.0的,但是你板子里面使用的是qtopia-1.7.0系统,那当然不能运行了。
要检查板子里的qtopia版本,可以点“应用程序”->“系统信息”查看。
[ 此帖被26672624在2009-05-07 09:12重新编辑 ]
怎么成高级会员?
级别: 新手上路
UID: 5450
精华: 0
发帖: 22
金钱: 220 两
威望: 220 点
综合积分: 44 分
注册时间: 2009-04-23
最后登录: 2009-06-30
7楼  发表于: 2009-05-09 21:34

 回 6楼(26672624) 的帖子

大哥谢谢你的支持,经过几天的努力,我终于把qtopia编译通过了,并把hello下到板上可以运行了。 ,不过make出错,依然没解决。我另一个同学也买了个友善公司出的板,我是用他的光盘的qtopia(旧板本)编译成功的。
不过在接下来编译qt程序又遇到了诸多问题,arm不好整啊!我在Ubuntu下面装qt4编的程序在RetHat9下面不能运行(版本问题,这我后来知道)。
然后自己想在x86/qtopia下编个程序,但又不知道这么编,文档都没说,最终我在光盘资料找到了一个“Qt-Embedded编程实战”,好不容易,但怎么编都不对,后来在网上搜了一下,终于明白,“尽信书,不如无书“的意思。
出现的问题一:undefined reference to `operator new(unsigned)''
/usr/local/arm/qt_x86/qt/lib/libqte.so: undefined reference to `operator new[](unsigned)''
/usr/local/arm/qt_x86/qt/lib/libqte.so: undefined reference to `__cxa_pure_virtual''
/usr/local/arm/qt_x86/qt/lib/libqte.so: undefined reference to `operator delete[](void*)''
collect2: ld returned 1 exit status
make: *** [button] Error 1
原因是Makefile 里的LINK 项应该为g++ 而不是gcc , 修改
tmake/lib/qws/linux-generic-g++/tmake.conf
#vi $TMAKEPATH/tmake.conf
将TMAKE_LINK = gcc 和TMAKE_LINK_SHLIB = gcc
分别修改成
TMAKE_LINK = g++和TMAKE_LINK_SHLIB = g++



出现的问题二:#qvfb &
#./button-qws
./button: error while loading shared libraries: libqte.so.2: cannot open shared object file: No such file or directory
解决方法:环境变量设置有问题
export LD_LIBRARY_PATH=$QTDIR/lib/:$QPEDIR/lib/

我现在X86/qtopia问题解决了,但arm/qtopia自己编的程序还没整,还不知道会遇到什么问题。大哥知不知道在arm/qtopia下怎么编译自己的程序,是不是在X86/qtopia下面编译通过的程序,在arm/qtopia一定能编译通过,并能下到板上
    
学习arm版
怎么成高级会员?
级别: 新手上路
UID: 5450
精华: 0
发帖: 22
金钱: 220 两
威望: 220 点
综合积分: 44 分
注册时间: 2009-04-23
最后登录: 2009-06-30
8楼  发表于: 2009-05-10 00:43

 回 6楼(26672624) 的帖子

在编译arm/qtopia的程序,
我先进入/opt/.../arm-qtopia
mkdir button
把button.cpp拷进button(这在x86/qtopia是可用的)
progen -t app.t  -o button.pro
tmake -o Makefile button.pro
make后给我报下面的错误
[root@localhost button]# make
gcc  -o button button.o   -L/opt/FriendlyARM/mini2440/arm-qtopia/qt/lib -lqte
/usr/bin/ld: skipping incompatible /opt/FriendlyARM/mini2440/arm-qtopia/qt/lib/libqte.so when searching for -lqte
/usr/bin/ld: cannot find -lqte
collect2: ld returned 1 exit status
make: *** [button] Error 1
按理来说x86/qtopia和arm/qtopia生成可执行文件方法是一样的,但道路却是这么曲折,大哥帮帮忙吧!
学习arm版
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
9楼  发表于: 2009-05-10 06:52

 回 8楼(liderun_2008) 的帖子

我给你的建议:在搞清楚为什么编译出错之前,先搞清楚你在编译什么,用什么编译,编译成功需要哪些条件,回答了这个问题之后再来提问题。否则那是在浪费大家的时间。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
  • «
  • 1
  • 2
  • »
  • Pages: 1/2     Go