程序代码:
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();
}
命令:
qmake -project
qmake
make
错误信息:
g++ -o qt h1.o -L/usr/X11R6/lib -lXext -lX11 -lm
h1.o(.text+OX30): In function 'main':
: undefined reference to 'QApplication::QApplication[in-charge](int&, char **)'
.......(以下是类似错误)......
collect2: ld returned 1 exit status
make: *** [qt] 错误 1
系统是gentoo linux2005.1 内核版本 2.6.12
qt版本3.3.4
请教这个错误如何处理一下呢?
[ 此贴被XChinux在2005-12-05 21:11重新编辑 ]