本文介绍了Qt5.11.2 windeployqt未创建有限依赖的dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试以调试模式运行应用程序时.错误:由于找不到Qt5Core.dll,代码执行无法继续."

When trying to run application with debug mode.. Error: "The code execution cannot proceed because Qt5Core.dll was not found."

当尝试以发布模式运行应用程序时..

When trying to run application with release mode..

问题1:MinGW将可执行文件视为调试可执行文件,因此windeployqt正在创建依赖于调试版本的dll!

problem1: MinGW considering executable as debug executable and hence windeployqt is creating debug version dependent dll!

问题2:出现与上述相同的错误-由于未找到Qt5Core.dll,因此无法继续执行代码."

problem2: Getting same error as shown in above - "The code execution cannot proceed because Qt5Core.dll was not found.".

有人可以为此提供解决方案吗?或要求提供指导以解决问题.

Can anyone provide solution for this? or request to guide for solving the problem.

同一问题发布在- Qt windeployqt导致无法使用的部署

windeployqt的输出

Output of windeployqt

<executable path>windeployqt 
<executable name>.exe 
<executable name>.exe 32 bit, debug executable 
Adding Qt5Svg for qsvgicond.dll 
Skipping plugin qtvirtualkeyboardplugind.dll due to disabled dependencies (Qt5Qml Qt5Quick). 
Direct dependencies: Qt5Core Qt5Gui Qt5Network Qt5Sql Qt5Widgets 
All dependencies : Qt5Core Qt5Gui Qt5Network Qt5Sql Qt5Widgets 
To be deployed : Qt5Core Qt5Gui Qt5Network Qt5Sql Qt5Svg Qt5Widgets 
Updating Qt5Cored.dll. 
Updating Qt5Guid.dll. 
Updating Qt5Networkd.dll.
Updating Qt5Sqld.dll. 
Updating Qt5Svgd.dll. 
Updating Qt5Widgetsd.dll. 
Updating libGLESV2d.dll. 
Updating libEGLd.dll. 
Updating D3Dcompiler_47.dll. 
Updating opengl32sw.dll. 
Updating libgcc_s_dw2-1.dll. 
Updating libstdc++-6.dll. 
Updating qsvgd.dll.
Updating qtgad.dll.
Updating qtiffd.dll.
Updating qwbmpd.dll.
Updating qwebpd.dll.
Creating directory <path of executable>/platforms. 
Updating qwindowsd.dll. 
Creating directory <path of executable>/sqldrivers. 
Updating qsqlited.dll. 
Updating qsqlmysqld.dll.
Updating qsqlodbcd.dll.
Updating qsqlpsqld.dll. 
Creating directory <path of executable>/styles.
Updating qwindowsvistastyled.dll. 
Creating <path of executable>\translations...
Creating qt_ar.qm... 
Creating qt_bg.qm...
Creating qt_ca.qm...
Creating qt_cs.qm...
Creating qt_da.qm...
Creating qt_de.qm...
Creating qt_en.qm...
Creating qt_es.qm...
Creating qt_fi.qm...
Creating qt_fr.qm...
Creating qt_gd.qm...
Creating qt_he.qm...
Creating qt_hu.qm...
Creating qt_it.qm...
Creating qt_ja.qm...
Creating qt_ko.qm...
Creating qt_lv.qm...
Creating qt_pl.qm...
Creating qt_ru.qm...
Creating qt_sk.qm...
Creating qt_uk.qm... 

推荐答案

实际上,Qt 5.11.2随同windeployqt一起提供了一个选项/标志,用于创建与调试/发布可执行文件相关的依赖项.

Actually Qt 5.11.2 is providing an option/flag along with windeployqt for creating dependencies associated with debug/release executable.

用于创建依赖于调试版本的dll:

For creation of debug version dependent dlls:

windeployqt可执行文件-调试

windeployqt executable --debug

用于创建发行版相关的dll:

For creation of release version dependent dlls:

windeployqt可执行文件-发行版

windeployqt executable --release

这解决了我的问题.

这篇关于Qt5.11.2 windeployqt未创建有限依赖的dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 16:16