• 5570阅读
  • 1回复

超级错误 希望大家帮忙 多些!! [复制链接]

上一主题 下一主题
离线小小草
 
只看楼主 正序阅读 楼主  发表于: 2006-05-23
我在编译 qte的时候出现 如下 错误信息 希望大家帮忙解决

[root@localhost hello]# make
g++ -c -I/qt/x86-qtopia/qt/include -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W -DNO_DEBUG -o hello.o hello.cpp
g++ -c -I/qt/x86-qtopia/qt/include -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W -DNO_DEBUG -o main.o main.cpp
/qt/x86-qtopia/qt/bin/moc hello.h -o moc_hello.cpp
g++ -c -I/qt/x86-qtopia/qt/include -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W -DNO_DEBUG -o moc_hello.o moc_hello.cpp
gcc -L/qt/x86-qtopia/qt/lib -Wl,-rpath,/qt/x86-qtopia/qt/lib   -o ./hello hello.o main.o moc_hello.o -lqte -lm
hello.o(.text+0x46): In function `Hello::Hello[not-in-charge](char const*, QWidget*, char const*)':
: undefined reference to `operator new(unsigned)'
hello.o(.text+0xde): In function `Hello::Hello[in-charge](char const*, QWidget*, char const*)':
: undefined reference to `operator new(unsigned)'
moc_hello.o(.text+0x15e): In function `Hello::staticMetaObject()':
: undefined reference to `QMetaObject::new_metaobject(char const*, char const*, QMetaData*, int, QMetaData*, int, QMetaProperty*, int, QMetaEnum*, int, QClassInfo*, int)'
moc_hello.o(.gnu.linkonce.r._ZTV5Hello+0x134): undefined reference to `QWidget::dragEnterEvent(QDragEnterEvent*)'
moc_hello.o(.gnu.linkonce.r._ZTV5Hello+0x138): undefined reference to `QWidget::dragMoveEvent(QDragMoveEvent*)'
moc_hello.o(.gnu.linkonce.r._ZTV5Hello+0x13c): undefined reference to `QWidget::dragLeaveEvent(QDragLeaveEvent*)'
moc_hello.o(.gnu.linkonce.r._ZTV5Hello+0x140): undefined reference to `QWidget::dropEvent(QDropEvent*)'
moc_hello.o(.gnu.linkonce.t._ZN5HelloD0Ev+0x5a): In function `Hello::~Hello [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
/qt/x86-qtopia/qt/lib/libqte.so: undefined reference to `operator new[](unsigned)'
/qt/x86-qtopia/qt/lib/libqte.so: undefined reference to `__cxa_pure_virtual'
/qt/x86-qtopia/qt/lib/libqte.so: undefined reference to `operator delete[](void*)'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
[ 此贴被XChinux在2006-05-23 18:03重新编辑 ]
共同进步!
离线shiroki

只看该作者 1楼 发表于: 2006-05-24
你这个错误我倒是知道怎么解决,但是不知道你这个错误是怎么出来的。。。
gcc -L/qt/x86-qtopia/qt/lib -Wl,-rpath,/qt/x86-qtopia/qt/lib   -o ./hello hello.o main.o moc_hello.o -lqte -lm
这一行的gcc改成g++就行了

你用来生成Makefile的命令行是什么?
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
快速回复
限100 字节
 
上一个 下一个