exe 文件不在 Release 文件夹中 运行

exe file is not running in Release folder

我的项目IDE:Visual Studio 2019,Qt 5.15.0。

我试图通过发布版本的 project_name.exe 文件启动应用程序,但没有任何反应。

Debug模式的project_name.exe文件运行宁好

该项目在调试和发布模式下 运行 也处于 IDE 状态。

我在 PATH 中添加了 Qt Bin 目录。

我尝试了 windeployqt 命令,但没有用。

根据构建输出和依赖项工具,我将应用程序依赖的所有 dll 文件复制到 Release 文件夹,但后来我无法 运行 它既不是来自 exe 文件也不是来自 IDE(当我尝试 运行 时没有任何编译错误或错误消息)。

运行从 Release 文件夹中下载 exe 文件缺少什么?

以下步骤终于解决了我的问题:

  1. 将项目目录下的qml文件夹复制到Release文件夹中(必须是 在 exe 文件附近)。
  2. 在 Release 文件夹中启动命令提示符并写入:windeployqt project_name.exe, 此步骤必须在拥有 qml 文件以获取整个所需部署之后进行 通过 windeployqt 命令生成文件。
  3. 从您的系统中将以下 dll 复制到 Release 文件夹中:opengl32.dll, libcrypto-1_1-x64.dll.
  4. 对于未安装 Visual Studio 的 VM,需要复制更多的 dll。