QT 版本:qt-sdk-win-opensource-2010.04。
添加环境变量:QMAKESPEC=win32-g++,win32-g++文件夹下的qmake.conf保持默认,QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc。
生成Makefile和编译:
C:\examples\chap01\hello>qmake -project
C:\examples\chap01\hello>qmake
C:\examples\chap01\hello>mingw32-make.exe release
mingw32-make.exe -f Makefile.Release
mingw32-make.exe[1]: Entering directory `C:/examples/chap01/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"..\..\..\Qt_Win\qt\include\QtCore" -I"..\..\..\Qt_Win\qt\include\QtGui
" -I"..\..\..\Qt_Win\qt\include" -I"." -I"..\..\..\Qt_Win\qt\include\ActiveQt" -
I"release" -I"..\..\..\Qt_Win\qt\mkspecs\win32-g++" -o release\hello.o hello.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\hello.exe release/hell
o.o -L"c:\Qt_Win\qt\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
mingw32-make.exe[1]: Leaving directory `C:/examples/chap01/hello'
但是运行MinGW编译的可执行文件,运行时会提示缺少MSVCP80.dll呢,好像我没有用到MS的编译器啊,这是为啥啊,大侠们帮帮忙啊?