记录visiual studio 编译qt5.15.6

准备工作
1.qt源码下载
可通过gitee下载,具体不介绍
2.perl安装
建议通过360软件管家安装,或者其他软件市场。比去官方下载快多了
3.python
我是用3.9的
4.visiual studio
我用的2022版
5.检查环境变量
python 和perl 是否都path中
开始编译
1.x64 Native Tools Command Prompt for VS 2022 打开这个,是VS安装的时候带的
2.切换到qt源码目录 x: 切换到源码盘区,再用cd ,这点和linux不一样
3.配置
configure -confirm-license -opensource -platform win32-msvc -release -prefix "C:\qt-5.15.6" -qt-sqlite -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -skip qtwebengine -nomake tests -nomake examples -mp
具体配置不一一介绍,自己动手。-release 则只编译release版本,那么编译安装后你只能编译release版应用,不能编译debug版应用,本人已测试。一般人还是建议-debug-and-release。-mp为多核编译
4.配置完成后运行 nmake 编译 ,本人16核cpu编译了1个小时左右
5.编译完成后 nmake install即可

posted @ 2022-11-16 11:02  ccc_zdh  阅读(137)  评论(0)    收藏  举报