教程上第一个例子
1 #include <QApplication>
2 #include <QLabel>
3 int main(int argc, char *argv[])
4 {
5 QApplication app(argc, argv);
6 QLabel *label = new QLabel("Hello Qt!");
7 label->show();
8 return app.exec();
9 }
我编译的时候会出现这样的错误
"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile.Release
cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"d:\Qt\4.4.3-msvc2008\include\QtCore" -I"d:\Qt\4.4.3-msvc2008\include\QtGui" -I"d:\Qt\4.4.3-msvc2008\include" -I"." -I"d:\Qt\4.4.3-msvc2008\include\ActiveQt" -I"release" -I"." -I"..\4.4.3-msvc2008\mkspecs\win32-msvc2008" -Forelease\ @C:\DOCUME~1\arthur\LOCALS~1\Temp\nm6.tmp
hello.cxx
.\hello.cxx(1) : error C2059: syntax error : 'constant'
.\hello.cxx(1) : error C2014: preprocessor command must start as first nonwhite space
.\hello.cxx(2) : error C2014: preprocessor command must start as first nonwhite space
.\hello.cxx(5) : error C2143: syntax error : missing ';' before '{'
.\hello.cxx(5) : error C2447: '{' : missing function header (old-style formal list?)
,各位高手提醒一下,谢谢啦,我是个Qt新手