• 14018阅读
  • 7回复

请问undefined reference to `QWidget::x11Event(_XEvent*)'是哪个参数没设对吗 [复制链接]

上一主题 下一主题
离线xqwxqw
 
只看楼主 倒序阅读 楼主  发表于: 2007-03-21
— 本帖被 XChinux 执行加亮操作(2008-05-08) —
在qte中用tmake生成的makefile文件后,执行make:
[root@localhost projector]# make
g++ -c -pipe -Wall -W -O2 -DNO_DEBUG -fno-rtti -fno-exceptions -I/public/qt/qt-2.3.2/include -o hello.o hello.cpp
/public/qt/qt-2.3.2/include/qtooltip.h:87: 警告:‘class QToolTip’ 有虚函数却没有虚析构函数
g++ -c -pipe -Wall -W -O2 -DNO_DEBUG -fno-rtti -fno-exceptions -I/public/qt/qt-2.3.2/include -o main.o main.cpp
/public/qt/qt-2.3.2/bin/moc hello.h -o moc_hello.cpp
g++ -c -pipe -Wall -W -O2 -DNO_DEBUG -fno-rtti -fno-exceptions -I/public/qt/qt-2.3.2/include -o moc_hello.o moc_hello.cpp
g++  -o hello hello.o main.o  moc_hello.o  -L/public/qt/qt-2.3.2/lib -L/usr/X11R6/lib -lqte -lXext -lX11 -lm
moc_hello.o(.gnu.linkonce.r._ZTV5Form1[vtable for Form1]+0x14c): undefined reference to `QWidget::x11Event(_XEvent*)'
moc_hello.o(.gnu.linkonce.r._ZTV5Form1[vtable for Form1]+0x1b8): undefined reference to `QPaintDevice::setX11Data(QPaintDeviceX11Data const*)'
collect2: ld 返回 1
make: *** [hello] 错误 1
请问高手为何啊?????
离线XChinux

只看该作者 1楼 发表于: 2007-03-22
一般是没有把库链接进去的缘故。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线honest581
只看该作者 2楼 发表于: 2007-06-08
sfsfds
离线honest581
只看该作者 3楼 发表于: 2007-06-08
到底怎么解决啊,我也遇到类似的问题我都搞了半个月了,也没有头绪
离线liubaosen
只看该作者 4楼 发表于: 2007-08-29
You're mixing rtti and non-rtti code. When compiling for Qt/Embedded make sure to add
-fno-rtti to the CXXFLAGS and LDFLAGS. Make sure not leave those out when compiling for
Qt/X11 . Ah, and also make sure when compiling for QT/Embedded to add a -DQWS to your
CXXFLAGS (it's missing above there aswell), that solves the x11Event errors. (the rtti
thingy fixes the type_info errors)
只有开源才能实现共产主义
离线hatoyu

只看该作者 5楼 发表于: 2008-05-08
引用第1楼XChinux于2007-03-22 09:00发表的  :
一般是没有把库链接进去的缘故。


具体那么加进去阿?
离线andyfly
只看该作者 6楼 发表于: 2009-07-20
我也出现了这样的问题,但是在Makefile中的CXXFLAGS和LDFLAGS里加入了-fno-rtti 还有报这个错误,请解答,谢谢
Andycavalier
离线caolei_xxoo
只看该作者 7楼 发表于: 2010-05-25
    
    执行make distclean
          rm hello.pro
          重新编译
快速回复
限100 字节
 
上一个 下一个