使⽤VS2019静态编译Qt5.15
准备⼯作提前安装VS2019,然后安装README⽂件中要求安装依赖⼯具,说明如下
Windows:
--------
Open a command prompt.
Ensure that the following tools can be found in the path:
* Supported compiler (Visual Studio 2012 or later,
MinGW-builds gcc 4.9 or later)
rubyinstaller包解压后怎么安装
* Perl version 5.12 or later [www.activestate/activeperl/]
* Python version 2.7 or later [www.activestate/activepython/]
* Ruby version 1.9.3 or later [/]
cd <path>\<source_package>
configure -prefix %CD%\qtbase <license> -nomake tests
nmake // jom // mingw32-make
To accelerate the bootstrap of qmake with MSVC, it may be useful to pass
"-make-tool jom" on the configure command line. If you do not use jom,
adding "/MP" to the CL environment variable is a good idea.
More details follow.
Build!
1、解压qt-everywhere-src-5.15.0到D盘
2、修改D:\qt-everywhere-src-5.15.0\qtbase\mkspecs\f
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MT
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT
QMAKE_CFLAGS_DEBUG = -Zi -MTd
3、打开x86 Native Tools Command Prompt for VS 2019 (建议管理员权限)
cd D:\qt-everywhere-src-5.15.0
D:
4、配置编译参数
configure.bat -static -prefix "C:\Qt\5.15.0\msvc2019_static" -confirm-license -opensource -debug-and-release -platform win32-msvc -nomake examples -nomake tests -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -mp
5、编译和安装,这⾥使⽤jom需要单独安装
D:\jom_1_1_
D:\jom_1_1_ install