Windeployqt 找不到所有的依赖项
Windeployqt does not find all the dependencies
我在发布模式下构建了我的Qt项目,并拥有.exe文件。我正在使用Qt 5.7 32-bit for Desktop (MSVC 2015)
cmd并运行C:Qt5.7msvc2015binwindeployqt.exe my_app.exe
但是,在运行它时,windeployqt
找不到所有依赖项。我得到这个输出。
Adding Qt5Svg for qsvgicon.dll
Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
All dependencies : Qt5Core Qt5Gui Qt5Widgets
To be deployed : Qt5Core Qt5Gui Qt5Svg Qt5Widgets
当我尝试运行.exe文件时,我仍然缺少Qt5Network.dll
、Qt5xml.dll
、Qt5XmlPatterns.dll
、Qt5WebEngineWidgets.dll
、Qt5WebEngineCore.dll
和Qt5Quick.dll
。它也缺少libeay32.dll
和ssleay32.dll
.
在我的 .pro 文件中,我有QT += core gui xml xmlpatterns widgets webenginewidgets network
我一直在寻找解决方案,即使我可以手动复制粘贴它们并且它可以工作或使用 -network -xml 等添加它们,我想看看是否有办法将所有依赖项添加在一起。
前言
我认为windeployqt
现在不会尝试部署libeay32.dll
和ssleay32.dll
,因为它们不在c:Qt5.8mingw53_32bin
(但是,它们在c:QtToolsmingw530_32optbin
如果windeployqt
工作无错误,那么windeployqt ./
部署所有Qt DLL,没有任何参数。
不幸的是,windeployqt
仍然是错误的,因为有时它不会创建必需的并且创建无用的。
因此,您可以添加必需的(例如。 --core
) 并跳过创建无用(例如。 --no-svg
):
windeployqt --compiler-runtime --core --gui --network --widgets --winextras --no-svg --no-system-d3d-compiler --no-translations --no-opengl-sw --no-angle ./
更多package_name和命令 — https://doc.qt.io/qt-5/windows-deployment.html。
答
您可以创建变量 QT 的 qmake-parser,在包名前面附加--
并插入到 windeployqt-command:
DESTDIR = "path/to/dest"
QT = core gui network widgets winextras
CONFIG( release, debug|release ) {
PACKAGES = ""
for(package,QT){
PACKAGES += "--$${package} "
}
NO_PACKAGES = --no-svg
--no-system-d3d-compiler --no-translations --no-opengl-sw --no-angle
RETURN = $$escape_expand(nt)
# windeployqt
QMAKE_POST_LINK += $$RETURN windeployqt --compiler-runtime
$${PACKAGES} $${NO_PACKAGES}
$$quote($$shell_path($$DESTDIR))
# copy OpenSSL dlls
OPENSSLFILES = $$shell_path($$PWD/../../bin_openssl_1.0.2h/*.dll)
DDIR = $$shell_path($$DESTDIR)
QMAKE_POST_LINK += $$RETURN $$QMAKE_COPY $$quote($$OPENSSLFILES) $$quote($$DDIR)
}
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 为什么野牛仍在使用"int yylex(void)",却找不到"int yylex(YYS
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 奇怪的(对我来说)返回声明 - 在谷歌上找不到任何关于它的信息
- 找不到QtResource文件中的文件
- VC++本机单元测试,找不到调试符号
- RegGetValue在当前用户下找不到名称
- 带有 -stdlib=libc++ 的 clang++ 9.0.1 找不到<optional>
- 在 Ubuntu 18.04 上,我编译的 cpp 可执行文件找不到 VTK7 依赖项
- 项目 A 依赖共享库 B,B 依赖 C,A 不依赖 C。当我使用 B 的 API 时,警告 B 找不到 C
- Windeployqt 找不到所有的依赖项
- 找不到 CMake 静态库的依赖项
- Maven NAR插件:在路径上找不到DLL依赖项
- 使用Visual Studio 11 RC调试时找不到DLL依赖项
- DLL 无法加载:0x8007007E找不到模块。不确定导致此依赖项问题的原因
- JNI HellowWorld 不满意链接错误 找不到依赖库
- PInvoke-找不到指定的模块.如何检查缺少的依赖项
- 找不到标识符,即使使用依赖于参数的查找和运算符<<也不明确
- 为什么这个基于 JNI 的 JBoss 模块会抛出错误"找不到依赖库"?