#include <QApplication>
#include "Mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow *window = new Mainwindow;
window->setWindowTitle("景区之星");
window->show();
return a.exec();
}
Mainwondow我已经在Mainwindow.h定义过了,但是却提示不是类型
编译时出错:
Running build steps for project Lastest...
Configuration unchanged, skipping QMake step.
Starting: C:/QT/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Users/fangwanzi/Desktop/Qt/Lastest'
C:/QT/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/fangwanzi/Desktop/Qt/Lastest'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QT\qt\include\QtCore" -I"c:\QT\qt\include\QtGui" -I"c:\QT\qt\include" -I"." -I"c:\QT\qt\include\ActiveQt" -I"debug" -I"c:\QT\qt\mkspecs\win32-g++" -o debug\main.o main.cpp
mingw32-make[1]: Leaving directory `C:/Users/fangwanzi/Desktop/Qt/Lastest'
mingw32-make: Leaving directory `C:/Users/fangwanzi/Desktop/Qt/Lastest'
main.cpp: In function 'int qMain(int, char**)':
main.cpp:8: error: expected type-specifier before 'Mainwindow'
main.cpp:8: error: cannot convert 'int*' to 'MainWindow*' in initialization
main.cpp:8: error: expected ',' or ';' before 'Mainwindow'
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.Error while building project Lastest
When executing build step 'Make'