C++ 无法启动程序,因为缺少 Qt5Cored.dll

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18161546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 21:46:20  来源:igfitidea点击:

Can't start a Program because Qt5Cored.dll is missing

c++qt5

提问by Amani

I compiled a simple Qt 5 project successful in Qt Creator. When run from within Qt Creator it works. But when i transferred the executable into another location is produces the following error message on the cmd console;

我在 Qt Creator 中成功编译了一个简单的 Qt 5 项目。从 Qt Creator 中运行时,它可以工作。但是当我将可执行文件传输到另一个位置时,在 cmd 控制台上会产生以下错误消息;

The program can't start because Qt5Cored.dll is missing from your computer.
Try reinstalling the program to fix this program.

I tried to find Qt5Cored.dll in the Qt5 directory could not find. But strange thing is the program runs from Qt Creator. Any help please. I'm on windows 7 64 bit using Qt5 with MinGW

我试图在Qt5目录下找不到Qt5Cored.dll找不到。但奇怪的是程序是从 Qt Creator 运行的。请任何帮助。我在 Windows 7 64 位上使用 Qt5 和 MinGW

采纳答案by huysentruitw

The file Qt5Cored.dllwill exist on your system, otherwise it would not work from Qt Creator either. I think it's just Windows search that lets you down. Open a cmd prompt and do a dir c:\Qt5Cored.dll /s

该文件Qt5Cored.dll将存在于您的系统上,否则它也不会在 Qt Creator 中工作。我认为这只是让您失望的 Windows 搜索。打开 cmd 提示符并执行dir c:\Qt5Cored.dll /s

Another note is that those *d.dllare debug DLL's, which means you are distributing a debug version of your application. You might want to build a release version for distribution instead. (In which case you'll need Qt5Core.dll)

另一个注意事项是那些*d.dll是调试 DLL,这意味着您正在分发应用程序的调试版本。您可能想要构建一个发布版本以进行分发。(在这种情况下,您将需要Qt5Core.dll

回答by Bonga the Poo

On my computer the Qt5Core.dlland other .dll files are stored here C:\Qt\Qt5.9.1\5.9.1\xxx\bin(where xxx is the compiler version). Your Qt version may differ.

在我的计算机上Qt5Core.dll,其他 .dll 文件存储在此处C:\Qt\Qt5.9.1\5.9.1\xxx\bin(其中 xxx 是编译器版本)。您的 Qt 版本可能有所不同。

Copy the .dll files you want to the application location (where your .exe file is). These are the minimum .dll files I needed to copy for my basic app to work:

将您想要的 .dll 文件复制到应用程序位置(您的 .exe 文件所在的位置)。这些是我需要复制的最小 .dll 文件才能让我的基本应用程序工作:

  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll
  • libwinpthread-1.dll
  • Qt5Core.dll
  • Qt5Gui.dll
  • Qt5Widgets.dll
  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll
  • libwinpthread-1.dll
  • Qt5Core.dll
  • Qt5Gui.dll
  • Qt5Widgets.dll

回答by Mujeeb Ishaque

For me, it was located in this directory. (Qt Version : 5.11.2) E:\Qute\5.11.2\mingw53_32\bin

对我来说,它位于这个目录中。(Qt 版本: 5.11.2) E:\Qute\5.11.2\mingw53_32\bin

On adding all the .dlls in the same dir. program worked.

在同一目录中添加所有 .dll。程序有效。

回答by framontb

Another option, instead copying .dll files to .exe folder, is to add the .dll location to the path environment. I added the .dll path to user environment path in Windows 10 and worked.

另一种选择是将 .dll 文件复制到 .exe 文件夹,而不是将 .dll 位置添加到路径环境中。我在 Windows 10 中将 .dll 路径添加到用户环境路径并工作。

回答by Gary Fowler

Possibly problem is that RStudio does not behave well when quitting. Try restarting Windows to properly close the Qt5 libraries.

可能的问题是 RStudio 在退出时表现不佳。尝试重新启动 Windows 以正确关闭 Qt5 库。