1、
[root@localhost helloqt]# make
g++ -Wl,-rpath,/usr/local/qt/lib -o cfconv .obj/main.o .obj/cfconvmainform.o .obj/moc_cfconvmainform.o -L/usr/local/qt/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x11c): undefined reference to `QWidget::graphicsContext(bool) const'
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x188): undefined reference to `QWidget::qwsEvent(QWSEvent*)'
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x18c): undefined reference to `QWidget::scanLine(int) const'
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x190): undefined reference to `QWidget::bytesPerLine() const'
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x1fc): undefined reference to `non-virtual thunk to QWidget::scanLine(int) const'
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x200): undefined reference to `non-virtual thunk to QWidget::bytesPerLine() const'
.obj/moc_cfconvmainform.o:(.rodata._ZTV14cfconvMainform[vtable for cfconvMainform]+0x204): undefined reference to `non-virtual thunk to QWidget::graphicsContext(bool) const'
collect2: ld 返回 1
make: *** [cfconv] 错误 1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DEBUG:
原因在于 之前 在配置错误情况下生产的 .obj 文件依旧存在, 再次make 时出错, 删除 编译产生的文件即可。
rm -rf `ls -a ./ | egrep -v "(.cpp$|.h$|.ui$|.pro$)"`
====================================================================================================================