• 5189阅读
  • 0回复

【提问】一个小程序在make时的问题 [复制链接]

上一主题 下一主题
离线liuzx
 
只看楼主 倒序阅读 楼主  发表于: 2006-04-12
我按照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 参数是怎么回事啊
快速回复
限100 字节
 
上一个 下一个