我按照qt教程的例子编写了如下的main.cpp文件
#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
生成了makefile,但make 时出现如下错误:
main.o(.text+0x0) : in function 'main' :
:mutiple definition of 'main'
main.o(.text+0x0) :first defined here
collect 2 :ld returned 1exit status
请教高手是怎么回事?搞了一天了都没搞定阿,我用的是qtx11free版
另外想问一下用 g++ -lqt 编译总提示没有 -lqt 参数是怎么回事啊