VS2010 编译 QT4.8.7 x64
1 下载qt4.8.7源代码,解压到合适位置(如本文为d:\qt\4.8.7)
2 设置环境变量:
set QMAKESPEC=win32-msvc2010
set QTDIR=d:\qt\4.8.7
3 修改配置文件:
修改\mkspecs\win32-msvc2010\qmake.conf
将QMAKE_CFLAGS_RELEASE的O2改为O1
或
安装补丁https://support.microsoft.com/en-us/kb/2280741或https://www.microsoft.com/en-us/download/details.aspx?id=23691
否则编译出的64位程序不能启动!
4 登录vs2010 x64 win64命令行工具
5 输入命令:
>> cd %QTDIR%
>> configure -shared -debug-and-release -confirm-license -opensource -platform win32-msvc2010 -no-webkit -no-plugin-manifests -qt-zlib -qt-libpng -qt-libjpeg -vcproj -mmx -3dnow -sse -sse2 -mp -opengl desktop -fast -no-qt3support -nomake examples -nomake demos -nomake tests –largefile
>> jom.exe -j 4
>> jom.exe clean
“jom is a clone of nmake to support the execution of multiple independent commands in parallel.”
参考:
https://slanla.com/blog/article/3z46lz
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
http://zxdflyer.blog.163.com/blog/static/2566426220127317484980/
http://www.cnblogs.com/elect-fans/archive/2012/03/25/2416998.html