qt 问题,make下有很多未定义是怎么回事
arm-linux-g++ -o helloworld1 .obj/main.o .obj/helllo.o .obj/moc_helllo.o -luuid /root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia/lib/libqtopia2.so /root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia/lib/libqtopia.so /root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia/lib/libqte.so -lqpe -L/root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia/lib -L/root/yizhi/qtopia-free-2.2.0/qt2/lib -L/root/yizhi/arminclude/
.obj/moc_helllo.o: In function `__static_initialization_and_destruction_0':
/root/helloworld1/.moc/moc_helllo.cpp:28: undefined reference to `QMetaObjectCleanUp::QMetaObjectCleanUp(char const*, QMetaObject* (*)())'
/root/helloworld1/.moc/moc_helllo.cpp:28: undefined reference to `QMetaObjectCleanUp::~QMetaObjectCleanUp()'
.obj/moc_helllo.o: In function `Form1::qt_property(int, int, QVariant*)':
/root/helloworld1/.moc/moc_helllo.cpp:98: undefined reference to `QDialog::qt_property(int, int, QVariant*)'
.obj/moc_helllo.o: In function `Form1::qt_emit(int, QUObject*)':
/root/helloworld1/.moc/moc_helllo.cpp:92: undefined reference to `QDialog::qt_emit(int, QUObject*)'
.obj/moc_helllo.o: In function `Form1::qt_cast(char const*)':
/root/helloworld1/.moc/moc_helllo.cpp:78: undefined reference to `QDialog::qt_cast(char const*)'
.obj/moc_helllo.o: In function `Form1::staticMetaObject()':
/root/helloworld1/.moc/moc_helllo.cpp:69: undefined reference to `QMetaObject::new_metaobject(char const*, QMetaObject*, QMetaData const*, int, QMetaData const*, int, QMetaProperty const*, int, QMetaEnum const*, int, QClassInfo const*, int)'
/root/helloworld1/.moc/moc_helllo.cpp:70: undefined reference to `QMetaObjectCleanUp::setMetaObject(QMetaObject*&)'
.obj/moc_helllo.o: In function `Form1::qt_invoke(int, QUObject*)':
/root/helloworld1/.moc/moc_helllo.cpp:87: undefined reference to `QDialog::qt_invoke(int, QUObject*)'
.obj/moc_helllo.o: In function `Form1::trUtf8(char const*, char const*)':
/root/helloworld1/.moc/moc_helllo.cpp:42: undefined reference to `QApplication::translate(char const*, char const*, char const*, QApplication::Encoding) const'
.obj/moc_helllo.o: In function `Form1::tr(char const*, char const*)':
/root/helloworld1/.moc/moc_helllo.cpp:34: undefined reference to `QApplication::translate(char const*, char const*, char const*, QApplication::Encoding) const'
.obj/moc_helllo.o:(.rodata+0x44): undefined reference to `QDialog::eventFilter(QObject*, QEvent*)'
.obj/moc_helllo.o:(.rodata+0x54): undefined reference to `QObject::setProperty(char const*, QVariant const&)'
.obj/moc_helllo.o:(.rodata+0x58): undefined reference to `QObject::property(char const*) const'
.obj/moc_helllo.o:(.rodata+0x64): undefined reference to `QObject::customEvent(QCustomEvent*)'
.obj/moc_helllo.o:(.rodata+0x84): undefined reference to `QWidget::setBackgroundMode(Qt::BackgroundMode)'
.obj/moc_helllo.o:(.rodata+0x88): undefined reference to `QWidget::setEraseColor(QColor const&)'
.obj/moc_helllo.o:(.rodata+0x8c): undefined reference to `QWidget::setErasePixmap(QPixmap const&)'
.obj/moc_helllo.o:(.rodata+0x94): undefined reference to `QWidget::setPaletteBackgroundColor(QColor const&)'
.obj/moc_helllo.o:(.rodata+0x98): undefined reference to `QWidget::setPaletteBackgroundPixmap(QPixmap const&)'
.obj/moc_helllo.o:(.rodata+0x170): undefined reference to `QDialog::contextMenuEvent(QContextMenuEvent*)'
.obj/moc_helllo.o:(.rodata+0x174): undefined reference to `QWidget::imStartEvent(QIMEvent*)'
.obj/moc_helllo.o:(.rodata+0x178): undefined reference to `QWidget::imComposeEvent(QIMEvent*)'
.obj/moc_helllo.o:(.rodata+0x17c): undefined reference to `QWidget::imEndEvent(QIMEvent*)'
.obj/moc_helllo.o:(.rodata+0x180): undefined reference to `QWidget::tabletEvent(QTabletEvent*)'
.obj/moc_helllo.o:(.rodata+0x184): undefined reference to `QWidget::dragEnterEvent(QDragEnterEvent*)'
.obj/moc_helllo.o:(.rodata+0x188): undefined reference to `QWidget::dragMoveEvent(QDragMoveEvent*)'
.obj/moc_helllo.o:(.rodata+0x18c): undefined reference to `QWidget::dragLeaveEvent(QDragLeaveEvent*)'
.obj/moc_helllo.o:(.rodata+0x190): undefined reference to `QWidget::dropEvent(QDropEvent*)'
.obj/moc_helllo.o:(.rodata+0x19c): undefined reference to `QWidget::x11Event(_XEvent*)'
.obj/moc_helllo.o:(.rodata+0x1b4): undefined reference to `QWidget::windowActivationChange(bool)'
.obj/moc_helllo.o:(.rodata+0x1bc): undefined reference to `QWidget::create(unsigned long, bool, bool)'
.obj/moc_helllo.o:(.rodata+0x1d4): undefined reference to `QWidget::setMicroFocusHint(int, int, int, int, bool, QFont*)'
.obj/moc_helllo.o:(.rodata+0x1fc): undefined reference to `QPaintDevice::setResolution(int)'
.obj/moc_helllo.o:(.rodata+0x200): undefined reference to `QPaintDevice::resolution() const'
.obj/moc_helllo.o:(.rodata+0x208): undefined reference to `QPaintDevice::x11RenderHandle() const'
.obj/moc_helllo.o:(.rodata+0x20c): undefined reference to `QPaintDevice::setX11Data(QPaintDeviceX11Data const*)'
.obj/moc_helllo.o:(.rodata+0x214): undefined reference to `non-virtual thunk to QWidget::metric(int) const'
.obj/moc_helllo.o:(.rodata+0x230): undefined reference to `typeinfo for QDialog'
collect2: ld returned 1 exit status
make: *** [helloworld1] Error 1
[解决办法]
helll.h类声明中加Q_OBJECT
make clean后再
make