我的main.cpp文件是(很简单的):
#include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow mainWin;
mainWin.show();
return app.exec();
}
make的时候出现问题,报错
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.4.0/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.4.0/include/QtCore -I/usr/local/Trolltech/Qt-4.4.0/include/QtCore -I/usr/local/Trolltech/Qt-4.4.0/include/QtGui -I/usr/local/Trolltech/Qt-4.4.0/include/QtGui -I/usr/local/Trolltech/Qt-4.4.0/include -I. -I. -I. -o main.o main.cpp
main.cpp:15: 错误:不能在返回类型中定义新类型
main.cpp:15: 附注:(‘MainWindow’ 的定义末尾可能缺少一个分号)
main.cpp:15: 错误:‘main’ 的声明指定了两个以上的数据类型
main.cpp:15: 错误:‘::main’ 必须返回 ‘int’
make: *** [main.o] 错误 1
睡可以告诉我是什么问题啊!