程序是这样的:
#include<qapplication.h>
#include<stdio.h>
main(int argc, char **argv)
{
printf("hello\n");
}
----------------
不包含#include<qapplication.h>可以正确编译,但是包含了之后,
编译后:
make
g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=\
0 -Wall -fPIC -DQT_NO_DEBUG -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o test.o test.cpp
test.cpp:6: warning: ISO C++ forbids declaration of `main' with no type
test.cpp: In function `int main(int, char**)':
test.cpp:6: warning: unused parameter `int argc'
test.cpp:6: warning: unused parameter `char**argv'
g++ -o qt test.o -L/usr/lib/ -L/usr/X11R6/lib/ -lXext -lX11 -lm
test.o(.gnu.linkonce.d._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
test.o(.gnu.linkonce.d._ZTV6QGList+0x10): undefined reference to `QGList::~QGList [in-charge]()'
test.o(.gnu.linkonce.d._ZTV6QGList+0x14): undefined reference to `QGList::~QGList [in-charge deleting]()'
test.o(.gnu.linkonce.d._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
test.o(.gnu.linkonce.d._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)'
test.o(.gnu.linkonce.d._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
test.o(.gnu.linkonce.d._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
test.o(.gnu.linkonce.d._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
test.o(.gnu.linkonce.d._ZTV15QDragEnterEvent+0x10): undefined reference to `QDropEvent::format(int) const'
test.o(.gnu.linkonce.d._ZTV15QDragEnterEvent+0x14): undefined reference to `QDropEvent::encodedData(char const*) const'
test.o(.gnu.linkonce.d._ZTV15QDragEnterEvent+0x18): undefined reference to `QDropEvent::provides(char const*) const'
......
这是什么问题啊
[ 此贴被XChinux在2006-04-16 23:00重新编辑 ]