#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[]){
QApplication app(argc,argv);
QLabel *label = new QLabel("<b>Hellow QT!</b>");
label->show();
return app->exec();
}
上面是网上到处流传的hello qt代码
编译到mingw32-make时出错提示:
C:\Qt\2009.03\qt\bin\hello>mingw32-make release
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/2009.03/qt/bin/hello'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS
_QMAIN -I"..\..\include\QtCore" -I"..\..\include\QtGui" -I"..\..\include" -I"."
-I"..\..\include\ActiveQt" -I"release" -I"..\..\mkspecs\win32-g++" -o release\he
llo.o hello.cpp
hello.cpp: In function `int qMain(int, char**)':
hello.cpp:7: error: base operand of `->' has non-pointer type `QApplication'
mingw32-make[1]: *** [release/hello.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/2009.03/qt/bin/hello'
mingw32-make: *** [release] Error 2
很不理解,请前辈们指教