天嵌 ARM开发社区

 找回密码
 注册
查看: 3948|回复: 11

[求助]first编译错误

[复制链接]
climberyoung 发表于 2009-11-26 01:00:40 | 显示全部楼层 |阅读模式
root@ubuntu:/opt/EmbedSky/Qte/arm-qtopia-2.2.0/pro/first# make
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qpeapplication.h\
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qpeglobal.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qlibrary.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qcom.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/quuid.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qtopiawinexport.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/timestring.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/applicationinterface.h
make: execvp: /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qpeapplication.h: Permission denied
make: *** [main.o] 错误 127
这个错误是什么原因,感觉并没有相关提示
 楼主| climberyoung 发表于 2009-11-26 10:57:04 | 显示全部楼层
本帖最后由 climberyoung 于 2009-11-26 11:12 编辑

发现我的makefile里的编译器没改,改了之后又提示
root@ubuntu:/opt/EmbedSky/Qte/arm-qtopia-2.2.0/pro/first# make
make: *** 没有规则可以创建“main.o”需要的目标“/opt/EmbedSky/Qte/arm_qtopia-2.2.0/qtopia/include/qtopia/qpeglobal.h”。 停止。
 楼主| climberyoung 发表于 2009-11-26 11:53:11 | 显示全部楼层
我在makefile里删除了相关行只留下
main.o: main.cpp \
                first.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qpeapplication.h
编译继续出错
root@ubuntu:/opt/EmbedSky/Qte/arm-qtopia-2.2.0/pro/first# make
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o first.o first.cpp
In file included from /opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qvariant.h:42,
                 from first.h:13,
                 from first.cpp:10:
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qstring.h: In member function 'ushort& QChar::unicode()':
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qstring.h:199: error: cannot bind packed field '((QChar*)this)->QChar::ucs' to 'ushort&'
In file included from first.cpp:19:
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qimage.h: In member function 'bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const':
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qimage.h:58: warning: suggest parentheses around && within ||
make: *** [first.o] 错误 1
 楼主| climberyoung 发表于 2009-11-26 11:57:23 | 显示全部楼层
本帖最后由 climberyoung 于 2009-11-26 12:02 编辑

版主,什么原因呢
亚瑟王 发表于 2009-11-26 14:31:12 | 显示全部楼层
怀疑你第一次修改Makefile文件时多删除了编译选项所致。
 楼主| climberyoung 发表于 2009-12-12 22:19:06 | 显示全部楼层
这次严格按照手册上的修改还是报如下错误
root@ubuntu:/opt/EmbedSky/Qte/arm-qtopia-2.2.0/pro/first# make

arm-linux-gcc  -o /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/bin/first first.o main.o first.o moc_first.o   -L/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/lib -L/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/lib -L/opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/ -lqpe -lqtopia -lqte

arm-none-linux-gnueabi-gcc: main.o: No such file or directory

make: *** [/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/bin/first] 错误 1
 楼主| climberyoung 发表于 2009-12-13 16:23:20 | 显示全部楼层
本帖最后由 climberyoung 于 2009-12-13 16:30 编辑

很奇怪,我直接到arm-qtopia-2.2.0下first目录去make,还是出现如下错误,但是我编译arm-qtopia-2.2.0是完全通过的,且制作好文件系统烧录到开发板上,程序都是可以运行的

root@ubuntu:/opt/EmbedSky/Qte/arm-qtopia-2.2.0/pro/first# make
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o main.o main.cpp
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o first.o first.cpp
In file included from first.cpp:17:
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qimage.h: In member function 'bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const':
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qimage.h:58: warning: suggest parentheses around && within ||
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o moc_first.o moc_first.cpp
moc_first.cpp:29: error: no 'void first::initMetaObject()' member function declared in class 'first'
moc_first.cpp:40: error: prototype for 'QString first::tr(const char*)' does not match any in class 'first'
first.h:22: error: candidate is: static QString first::tr(const char*, const char*)
moc_first.cpp: In static member function 'static QMetaObject* first::staticMetaObject()':
moc_first.cpp:63: error: 'new_metadata' is not a member of 'QMetaObject'
moc_first.cpp:64: error: 'new_metaaccess' is not a member of 'QMetaObject'
moc_first.cpp:66: error: 'struct QMetaData' has no member named 'ptr'
moc_first.cpp:66: error: 'QMember' was not declared in this scope
moc_first.cpp:66: error: expected `;' before 'ov1_0'
moc_first.cpp:76: error: no matching function for call to 'QMetaObject::new_metaobject(const char [6], const char [8], QMetaData*&, int, int, int, int, int, int, int, int, int)'
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qmetaobject.h:211: note: candidates are: static QMetaObject* QMetaObject::new_metaobject(const char*, QMetaObject*, const QMetaData*, int, const QMetaData*, int, const QMetaProperty*, int, const QMetaEnum*, int, const QClassInfo*, int)
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qmetaobject.h:219: note:                 static QMetaObject* QMetaObject::new_metaobject(const char*, QMetaObject*, const QMetaData*, int, const QMetaData*, int, const QMetaProperty*, int, const QMetaEnum*, int, bool (*)(QObject*, int, int, QVariant*), const QClassInfo*, int)
moc_first.cpp:77: error: 'class QMetaObject' has no member named 'set_slot_access'
moc_first.cpp:62: warning: unused variable 'ov1_0'
make: *** [moc_first.o] 错误 1
 楼主| climberyoung 发表于 2009-12-13 16:35:46 | 显示全部楼层
beep下也同样提示
root@ubuntu:/opt/EmbedSky/Qte/arm-qtopia-2.2.0/pro/beep# make
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o main.o main.cpp
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o beep.o beep.cpp
In file included from beep.cpp:19:
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qimage.h: In member function 'bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const':
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qimage.h:58: warning: suggest parentheses around && within ||
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include -I/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include -o moc_beep.o moc_beep.cpp
moc_beep.cpp:29: error: no 'void beep::initMetaObject()' member function declared in class 'beep'
moc_beep.cpp:40: error: prototype for 'QString beep::tr(const char*)' does not match any in class 'beep'
beep.h:24: error: candidate is: static QString beep::tr(const char*, const char*)
moc_beep.cpp: In static member function 'static QMetaObject* beep::staticMetaObject()':
moc_beep.cpp:71: error: 'new_metadata' is not a member of 'QMetaObject'
moc_beep.cpp:72: error: 'new_metaaccess' is not a member of 'QMetaObject'
moc_beep.cpp:74: error: 'struct QMetaData' has no member named 'ptr'
moc_beep.cpp:74: error: 'QMember' was not declared in this scope
moc_beep.cpp:74: error: expected `;' before 'ov1_0'
moc_beep.cpp:77: error: 'struct QMetaData' has no member named 'ptr'
moc_beep.cpp:77: error: expected `;' before 'ov1_1'
moc_beep.cpp:80: error: 'struct QMetaData' has no member named 'ptr'
moc_beep.cpp:80: error: expected `;' before 'ov1_2'
moc_beep.cpp:90: error: no matching function for call to 'QMetaObject::new_metaobject(const char [5], const char [8], QMetaData*&, int, int, int, int, int, int, int, int, int)'
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qmetaobject.h:211: note: candidates are: static QMetaObject* QMetaObject::new_metaobject(const char*, QMetaObject*, const QMetaData*, int, const QMetaData*, int, const QMetaProperty*, int, const QMetaEnum*, int, const QClassInfo*, int)
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt/include/qmetaobject.h:219: note:                 static QMetaObject* QMetaObject::new_metaobject(const char*, QMetaObject*, const QMetaData*, int, const QMetaData*, int, const QMetaProperty*, int, const QMetaEnum*, int, bool (*)(QObject*, int, int, QVariant*), const QClassInfo*, int)
moc_beep.cpp:91: error: 'class QMetaObject' has no member named 'set_slot_access'
moc_beep.cpp:66: warning: unused variable 'ov1_0'
moc_beep.cpp:68: warning: unused variable 'ov1_1'
moc_beep.cpp:70: warning: unused variable 'ov1_2'
make: *** [moc_beep.o] 错误 1
亚瑟王 发表于 2009-12-14 11:55:29 | 显示全部楼层
6楼的错误:arm-none-linux-gnueabi-gcc: main.o: No such file or directory,提示信息没有找到main.o,可能是没有main.c文件导致的,也可能是Makefile文件中写错了。
7、8楼的错误:如果你确认你的arm版本的qtopia2.2.0编译成功了的话,应该是你没有设置环境变量导致的错误哦。
 楼主| climberyoung 发表于 2009-12-14 12:09:50 | 显示全部楼层
仔细分析了arm-qtopia-2.2.0_build文件,然后分析了pro下的builed文件,发现编译这几个应用程序的时候,环境变量设置的是/opt/EmbedSky/Qte/arm-qtopia-2.2.0/. SetQteEnv
setQteEnv内容如下
#!/bin/sh
export QPEDIR=/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia
export QTDIR=/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qt2
export TMAKEDIR=/opt/EmbedSky/Qte/arm-qtopia-2.2.0/tmake
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

而编译qt2.2.0时设置的setARM_QteEnv内容
#!/bin/sh

export QTDIR=/opt/EmbedSky/Qte/arm-qtopia-2.2.0/dqt
export TMAKEDIR=/opt/EmbedSky/Qte/arm-qtopia-2.2.0/tmake
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
 楼主| climberyoung 发表于 2009-12-14 12:10:51 | 显示全部楼层
为什么编译应用程序时qtdir是qt2,而编译qt2.2.0的qtdir是dqt呢?
亚瑟王 发表于 2009-12-17 19:01:07 | 显示全部楼层
qt2中的库才是我们需要的qte的库。Qt手册更新了,建议下载新版本的来看。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-3 06:41 , Processed in 1.062500 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表