将 QMAKESPEC win32-msvc 删除掉编译结果是。。。
D:\hello>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/hello'
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"..\Qt
\2009.05\qt\include\QtCore" -I"..\Qt\2009.05\qt\include\QtGui" -I"..\Qt\2009.05\
qt\include" -I"." -I"..\Qt\2009.05\qt\include\ActiveQt" -I"debug" -I"..\Qt\2009.
05\qt\mkspecs\default" -o debug\hello.o hello.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\hello.exe debug/hello.o -L"d:\
Qt\2009.05\qt\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `D:/hello'
代码是qt GUI的
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
环境变量:
path D:\Qt\2009.05\qt\bin;D:\Qt\2009.05\mingw\bin
QTDIR D:\Qt