-
下载4.8.7源码Index of /archive/qt/4.8/4.8.7
-
复制
mkspecs\win32-msvc2015
到mkspecs\win32-msvc2019
-
修改
qmake.conf
-
第2行:
2017=>2019
-
第4行:
2017=>2019
-
第12行:
_MSC_VER=1920
-
第19行:
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t
-
第22行:
QMAKE_CFLAGS_RELEASE = -O2 -MD -Zi
-
-
修改
qmake\Makefile.win32
-
第1行:
!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" || "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-msvc2019" || "$(QMAKESPEC)" == "win32-icc"
-
第27行:
!elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" || "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-msvc2019"
-
-
修改
tools\configure\configure.pro
-
第23行:
win32-msvc2015: DEFINES += _ALLOW_KEYWORD_MACROS win32-msvc2019: DEFINES += _ALLOW_KEYWORD_MACROS
-
-
修改
tools\configure\configureapp.cpp
-
第1379行:
qmakeSpec.endsWith("-msvc2015") || qmakeSpec.endsWith("-msvc2019")) {
-
-
修改
\src\3rdparty\clucene\src\CLucene\StdHeader.h
第127行,增加宏定义,消除
hash_map
和hasn_set
的警告:#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
-
Configure
命令:configure -make nmake -static -platform win32-msvc2019 -debug-and-release -opensource -confirm-license -nomake examples -nomake tests -nomake docs -nomake demos -prefix "F:\Code\Library\Qt\Qt4.8.7\4.8.7\msvc2019_86_static" -no-qt3support -no-dbus -no-webkit -no-phonon -no-opengl -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -no-phonon-backend -no-multimedia -no-script -no-scripttools -qt-style-windowsxp -qt-style-windowsvista -qt-style-plastique -qt-style-cleanlooks -qt-style-motif -no-native-gestures -mp
-
添加
bin
文件夹到系统路径Path
F:\Code\Library\Qt\Qt4.8.7\qt-everywhere-opensource-src-4.8.7\bin
-
打开
x86 Native Tools Command Prompt for VS 2019
,到代码路径F:\Code\Library\Qt\Qt4.8.7\qt-everywhere-opensource-src-4.8.7
,编译configure -make nmake -static -platform win32-msvc2019 -debug-and-release -opensource -confirm-license -nomake examples -nomake tests -nomake docs -nomake demos -prefix "F:\Code\Library\Qt\Qt4.8.7\4.8.7\msvc2019_86_static" -no-qt3support -no-dbus -no-webkit -no-phonon -no-opengl -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -no-phonon-backend -no-multimedia -no-script -no-scripttools -qt-style-windowsxp -qt-style-windowsvista -qt-style-plastique -qt-style-cleanlooks -qt-style-motif -no-native-gestures -mp nmake && nmake install
-
参考
msvc2015 编译 Qt 4.8.7 和 4.8.6 - 流浪侠客 - 博客园 (cnblogs.com)
Compiling Qt4 HEAD with MSVC 2015 - cstdint errors | Qt Forum
Building Qt 4.8.7 with Visual Studio 2017? | Qt Forum
Installing Qt for Windows | Qt 4.8
qt4.8.7 源码在win7+vs2010环境的x64编译(qt 64位)_木泽八的博客-CSDN博客
在Visual Studio高版本中使用Qt4,MSVC 2015/2017编译Qt 4.8.7源码_利白的博客-CSDN博客_qt4 vs2017
district10/qt4-vs2015x64: Qt4 & Visual Studio 2015 (vc14). (github.com)
sandym/qt-patches: Patches to some release versioin of Qt I use (github.com)
在 VS2015 中使用 Qt4 - 简书 (jianshu.com)