QT 5.7.1 Debug静态库的安装

REM 1. 设置 VS2013 环境
call "D:\VS2013\VS2013pack\VC\vcvarsall.bat" x86

REM 2. 进入 Qt 源码目录
cd /d D:\QT5.7.1Lib\qt-everywhere-opensource-src-5.7.1-Debug

REM 3. 运行 configure
.\configure.bat -static -debug -platform win32-msvc2013 ^
-opensource -confirm-license ^
-nomake examples -nomake tests ^
-opengl desktop ^
-qt-zlib -qt-freetype -qt-libpng -qt-libjpeg ^
-no-openssl ^
-prefix D:\Qt5.7.1\qt-static-msvc2013-debug

REM 4. 修改 mkspecs 文件(将 /MDd 改为 /MTd)
for /r %f in (qmake.conf) do @powershell -Command "(Get-Content '%f') -replace '/MDd', '/MTd' | Set-Content '%f'"

REM 5. 编译
nmake

REM 6. 安装
nmake install

 

 

 

第四步如果提示找不到路径

REM 2. 查找文件
dir /s /b qmake.conf

REM 3. 根据找到的路径修改(假设找到的是 qtbase\mkspecs\win32-msvc2013\qmake.conf)
powershell -Command "(Get-Content 'qtbase\mkspecs\win32-msvc2013\qmake.conf') -replace '/MDd', '/MTd' | Set-Content 'qtbase\mkspecs\win32-msvc2013\qmake.conf'"

 

posted on 2026-01-12 21:05  longjiajia  阅读(2)  评论(0)    收藏  举报

导航