问题
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;
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
回答1:
The file Qt5Cored.dll
will 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
Another note is that those *d.dll
are 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
)
回答2:
On my computer the Qt5Core.dll
and 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.
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:
libgcc_s_dw2-1.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
回答3:
For me, it was located in this directory. (Qt Version : 5.11.2) E:\Qute\5.11.2\mingw53_32\bin
On adding all the .dlls in the same dir. program worked.
回答4:
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.
回答5:
Possibly problem is that RStudio does not behave well when quitting. Try restarting Windows to properly close the Qt5 libraries.
来源:https://stackoverflow.com/questions/18161546/cant-start-a-program-because-qt5cored-dll-is-missing