- 准备:
- qt源码下载:https://download.qt.io/archive/qt/5.15/5.15.2/single/ 并解压
- python下载安装
安装Ruby
创建脚本文件 https://www.cryfeifei.cn/2020/06/28/qt-compile-windows/ 执行脚本,修改配置文件,生成makefile
//指定了安装路径-prefix "D:\QtVersion\Qt5.13_Build_MT_X64\qt5.13_build_mt"
configure -confirm-license -opensource -debug -prefix "D:\QtVersion\Qt5.13_Build_MT_X64\qt5.13_build_mt" -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -no-compile-examples -nomake examples
//未指定安装路径-prefix "D:\QtVersion\Qt5.13_Build_MT_X64\qt5.13_build_mt"
configure -confirm-license -opensource -debug -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -no-compile-examples -nomake examples
输入nmake,执行makefile
- nmake install 安装,前面执行的未指定安装路径,这里默认安装C盘。
configure -confirm-license -opensource -debug -prefix “D:\Qt\Qt5.15.2\x64” -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -no-compile-examples -nomake examples
方式二
- 下载源码并解压
创建.cmd文件
SET _ROOT=D:\Qt\qt-everywhere-src-5.15.2
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
调用vs工具
configure -debug -nomake examples -nomake tests -opensource -prefix D:\Qt\Qt5.15.2\x64
nmake
nmake install
直接安装
https://mirrors.tuna.tsinghua.edu.cn/qt/official_releases/online_installers/