Qt exe自动拷贝依赖dll

来源:互联网 发布:网络诈骗彩票套路 编辑:程序博客网 时间:2024/06/07 09:05

windeployqt 找出依赖,并自动拷贝到当前目录


通过 Qt "D:\Qt\Qt5.4.0\5.4\msvc2013_64\bin\windeployqt.exe" 命令找出依赖的库


windeployqt QtWebApp.exe

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
D:\qtcode\build-QtWebApp-Desktop_Qt_5_4_0_MSVC2013_64bit-Release\tmp\QtWebApp.ex
e 64 bit, release executable
Direct dependencies: Qt5Core Qt5Network Qt5Sql
All dependencies   : Qt5Core Qt5Network Qt5Sql
To be deployed     : Qt5Core Qt5Network Qt5Sql
Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not s
et.
Updating icuin53.dll.
Updating icuuc53.dll.
Updating icudt53.dll.
Updating Qt5Core.dll.
Updating Qt5Network.dll.
Updating Qt5Sql.dll.
Creating directory bearer.
Updating qgenericbearer.dll.
Updating qnativewifibearer.dll.
Creating directory sqldrivers.
Updating qsqlite.dll.
Updating qsqlmysql.dll.
Updating qsqloci.dll.
Updating qsqlodbc.dll.
Updating qsqlpsql.dll.

所依赖的 Qt 库都会自动拷贝到当录下!

注意:

Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not s

et

直接用 "VS2013 开发人员命令提示" 命令行去,执行刚才的 windeployqt QtWebApp.exe,会将 "vcredist_x64.exe"(vc x64 运行最少环境)程序放入当前目录。


建议:将所用到的库与开发环境的路径都放入 PATH 环境变量中设置好,这样使用 windeployqt 都能找到对应的 dll.当然使用对应的 工具的 "命令行工具" 也是可以的!



wKioL1T1Ueey_wlqAAGtbUg5irY587.jpg

Qt绿色版的程序就这样生成完成!
阅读全文
0 0
原创粉丝点击