QT5.15.2静态编译MSVC2019

下载源码:

官网:下载地址

腾讯源:下载地址

清华源:下载地址

查看源码编译环境

源码目录中的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)
     * Perl version 5.12 or later   [http://www.activestate.com/activeperl/]
     * Python version 2.7 or later  [http://www.activestate.com/activepython/]
     * Ruby version 1.9.3 or later  [http://rubyinstaller.org/]

     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!
 ======

一、安装VS2019

下载地址

任意版本均可。

二、安装perl

下载地址

 

 根据自已操作系统选择32位还是64位,注意环境变量的填加。

三、安装python

 下载地址

 

 四、安装Ruby

下载地址

注意:版本最好与说明文件中一致,否则会导致编译出问题。

五、准备编译

解压源码后,在同目录新建一个build文件夹用于放置编译文件,避免和源码文件一起会改动源码结构。

64位编译

 

 运行VS2019的编译窗口,cd切换至上面新建的build目录

F:\Qt\src\configure -confirm-license -opensource -release -static -static-runtime -nomake examples -nomake tests -skip qtwebengine -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-sqlite -opengl desktop -mp -prefix C:\Qt\5.15.2\msvc2019_64_static

 这是我用的编译命令,编译没有报错。

32位编译同64位编译一样,只是换成vs2019 x86的编译窗口

F:\Qt\src\configure -confirm-license -opensource -release -static -static-runtime -nomake examples -nomake tests -skip qtwebengine -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -qt-sqlite -opengl desktop -mp -prefix C:\Qt\5.15.2\msvc2019_32_static

 接下来执行 nmake & nmake install(使用jom的话用 jom -j xx &jom -j xx install代替)

jom:下载地址   注意:要手动添加环境变量。

32位和64位我都编译过了,没有问题。

我只是编译了release版,如果要编译debug版,将命令中的-release换成-debug即可,同时编译debug版和release版,换成-debug-and-release即可。

  • 10
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值