Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 已部署的Qt应用程序QtWebEngineProcess无法加载Qt5Core.dll_C++_Qt_Deployment - Fatal编程技术网

C++ 已部署的Qt应用程序QtWebEngineProcess无法加载Qt5Core.dll

C++ 已部署的Qt应用程序QtWebEngineProcess无法加载Qt5Core.dll,c++,qt,deployment,C++,Qt,Deployment,我需要帮助将Qt 5.14.1 x64应用程序正确部署到客户端的Windows 10 PC。该应用程序使用QtWebEngineProcess在一个选项卡式界面窗口中显示谷歌地图 在Visual Studio 2019(目前为最新版本16.4.5)更新之前,或者在QT版本从之前的版本更新之前(我认为使用的是版本5.13.2),这一直都可以正常工作。我不知道是哪种变化导致了错误 问题是当应用程序在客户端的PC上启动时(没有Visual Studio或Qt)。当我双击应用程序时,它会暂停几秒钟,最后

我需要帮助将Qt 5.14.1 x64应用程序正确部署到客户端的Windows 10 PC。该应用程序使用
QtWebEngineProcess
在一个选项卡式界面窗口中显示谷歌地图

在Visual Studio 2019(目前为最新版本16.4.5)更新之前,或者在QT版本从之前的版本更新之前(我认为使用的是版本5.13.2),这一直都可以正常工作。我不知道是哪种变化导致了错误

问题是当应用程序在客户端的PC上启动时(没有Visual Studio或Qt)。当我双击应用程序时,它会暂停几秒钟,最后会弹出一个对话框,指出它找不到Qt5Core.dll。(与应用程序位于同一文件夹中),此后不久,它将显示另一个对话框,错误代码为0xc0000022

它们与从主应用程序可执行文件(app739.exe)实例化的子进程(QtWebEngineProcess.exe)关联

将工作(先前)版本与当前工作版本进行比较,我注意到在
VCRUNTIME140_1.DLL
上有一个新的DLL依赖项。这似乎与异常处理有关,但是QtWebEngineProcess.exe没有将此dll作为依赖项列出

应用程序的部署如下所示:

F:\Common\coffey\CoPilotTesterV23.0\app739.exe 64 bit, release executable
Adding Qt5Svg for qsvgicon.dll
Skipping plugin qmldbg_debugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_inspector.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_local.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_messages.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_native.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_nativedebugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_preview.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_profiler.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_quickprofiler.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_server.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_tcp.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qsgd3d12backend.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Direct dependencies: Qt5Core Qt5Gui Qt5SerialPort Qt5Widgets Qt5WebEngineWidgets Qt5WebChannel
All dependencies   : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
To be deployed     : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Svg Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
Qt5QmlModels.dll is up to date.
Qt5Core.dll is up to date.
Qt5Gui.dll is up to date.
Qt5Network.dll is up to date.
Qt5Positioning.dll is up to date.
Qt5PrintSupport.dll is up to date.
Qt5Qml.dll is up to date.
Qt5Quick.dll is up to date.
Qt5QuickWidgets.dll is up to date.
Qt5SerialPort.dll is up to date.
Qt5Svg.dll is up to date.
Qt5Widgets.dll is up to date.
Qt5WebEngineCore.dll is up to date.
Qt5WebEngineWidgets.dll is up to date.
Qt5WebChannel.dll is up to date.
libGLESV2.dll is up to date.
libEGL.dll is up to date.
d3dcompiler_47.dll is up to date.
opengl32sw.dll is up to date.
qgenericbearer.dll is up to date.
qsvgicon.dll is up to date.
qgif.dll is up to date.
qicns.dll is up to date.
qico.dll is up to date.
qjpeg.dll is up to date.
qsvg.dll is up to date.
qtga.dll is up to date.
qtiff.dll is up to date.
qwbmp.dll is up to date.
qwebp.dll is up to date.
qwindows.dll is up to date.
qtposition_positionpoll.dll is up to date.
qtposition_serialnmea.dll is up to date.
qtposition_winrt.dll is up to date.
windowsprintersupport.dll is up to date.
qwindowsvistastyle.dll is up to date.
Deploying: QtWebEngineProcess...
QtWebEngineProcess.exe is up to date.
F:\Common\coffey\CoPilotTesterV23.0\app739.exe 64 bit, release executable
Adding Qt5Svg for qsvgicon.dll
Skipping plugin qmldbg_debugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_inspector.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_local.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_messages.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_native.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_nativedebugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_preview.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_profiler.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_quickprofiler.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_server.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_tcp.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qsgd3d12backend.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Direct dependencies: Qt5Core Qt5Gui Qt5SerialPort Qt5Widgets Qt5WebEngineWidgets Qt5WebChannel
All dependencies   : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
To be deployed     : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Svg Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
Qt5QmlModels.dll is up to date.
Qt5Core.dll is up to date.
Qt5Gui.dll is up to date.
Qt5Network.dll is up to date.
Qt5Positioning.dll is up to date.
Qt5PrintSupport.dll is up to date.
Qt5Qml.dll is up to date.
Qt5Quick.dll is up to date.
Qt5QuickWidgets.dll is up to date.
Qt5SerialPort.dll is up to date.
Qt5Svg.dll is up to date.
Qt5Widgets.dll is up to date.
Qt5WebEngineCore.dll is up to date.
Qt5WebEngineWidgets.dll is up to date.
Qt5WebChannel.dll is up to date.
libGLESV2.dll is up to date.
libEGL.dll is up to date.
d3dcompiler_47.dll is up to date.
opengl32sw.dll is up to date.
qgenericbearer.dll is up to date.
qsvgicon.dll is up to date.
qgif.dll is up to date.
qicns.dll is up to date.
qico.dll is up to date.
qjpeg.dll is up to date.
qsvg.dll is up to date.
qtga.dll is up to date.
qtiff.dll is up to date.
qwbmp.dll is up to date.
qwebp.dll is up to date.
qwindows.dll is up to date.
qtposition_positionpoll.dll is up to date.
qtposition_serialnmea.dll is up to date.
qtposition_winrt.dll is up to date.
windowsprintersupport.dll is up to date.
qwindowsvistastyle.dll is up to date.
icudtl.dat is up to date.
qtwebengine_devtools_resources.pak is up to date.
qtwebengine_resources.pak is up to date.
qtwebengine_resources_100p.pak is up to date.
qtwebengine_resources_200p.pak is up to date.
en-US.pak is up to date.
这是依赖项信息:

F:\Common\coffey\CoPilotTesterV23.0>dumpbin /dependents app739.exe
Microsoft (R) COFF/PE Dumper Version 14.24.28316.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file app739.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    BTI42964.dll
    Qt5WebEngineWidgets.dll
    Qt5Widgets.dll
    Qt5Gui.dll
    Qt5SerialPort.dll
    Qt5WebChannel.dll
    Qt5Core.dll
    MSVCP140.dll
    WS2_32.dll
    BTICard64.dll
    KERNEL32.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    SHELL32.dll
    api-ms-win-crt-utility-l1-1-0.dll

  Summary

        C000 .data
       13000 .pdata
       FF000 .rdata
        3000 .reloc
       4C000 .rsrc
      1BC000 .text

(不同于标准Qt5应用程序部署):


Qt WebEngine利用了 铬项目提供的多过程模型。这个 多进程模型要求Qt WebEngine进程是可执行的 与应用程序一起部署

对每个
QWebEngineView
WebEngineView
实例。例如,具有两个 打开的选项卡应该有两个单独的进程运行实例。 这是大多数现代web引擎用来提供 稳定的浏览体验

在运行时,Qt WebEngine查找QtWebEngineProcess可执行文件 在目录中
QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath)
返回。 对于Qt安装,这是
QTDIR/libexe
c(Linux)或
QTDIR\bin
(窗口)。路径可以通过定义来更改,例如 实例或者,可执行路径可以设置为的值
QTWEBENGINEPROCESS\u路径
环境变量。关于macOS,Qt WebEngine在
.app/Helpers/QtWebEngineProcess

首先,需要检查路径
QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath)返回

另外:适用于Windows的标准Qt5应用程序部署控制台工具-


另请参见:

我在使用Qt 5.15和VS 2019时遇到了同样的问题。但是,只有当我的应用程序部署在网络驱动器上时,问题才会出现。qt5Core.dll位于同一文件夹中的同一组文件在所有本地驱动器上都可以正常工作。

在Windows 10上运行QT 5.15.1时,我遇到了类似的问题。QtWebEngineProcess.exe无法找到Qt5Core.dll,即使它与可执行文件位于同一文件夹中。对我来说,当我禁用沙箱时,问题就解决了,请参阅。

感谢上面的提示,但是它们并没有真正指向任何新的内容。基本问题似乎是将DLL搜索路径传递给我的应用程序的子进程。出于某种让我困惑的奇怪原因,包含google maps的选项卡试图启动依赖于Qt5Core.dll的QtWebEngineProcess.exe,而启动的进程由于找不到dll(与可执行文件位于同一当前目录中)而停止。对话框关闭后,我的主应用程序运行(带有一个空白的google maps页面),我可以看到主应用程序正在使用这些Qt5*.dll文件。@johnco3似乎webengine部署很特别。你读了吗?有用的链接。我尝试手动将QTDIR设置为DLL的位置,但仍然没有成功。这并不能解释为什么以前的版本部署得很好。我想知道是否有某种方法可以获取QT正在搜索且无法从中获取库的内部日志,例如在visual studio ide的控制台输出中,它指示加载和卸载各种DLL和符号文件。@johnco3您可以检查
QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath)的输出吗
是否适用于两个版本?你能在一个干净的系统上运行这两个版本吗?@JakeW我知道这是我之前回答过的很长一段时间了-但是你可以看到我确实解决了这个问题-我需要添加--no sandbox环境变量
qputenv(“QTWEBENGINE\u chromiu FLAGS”,“--no sandbox”)
请参见上面的公认答案好的捕获-这个错误捕获了我一年多!真的是非常虚幻的错误。非常感谢,它解决了我的问题