23

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

Amani
  • 16,245
  • 29
  • 103
  • 153

7 Answers7

13

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)

huysentruitw
  • 27,376
  • 9
  • 90
  • 133
  • I did the release version and now it asks for Qt5Core.dll. When I search in the Qt5 directory its there. Can't this be because I do not do static linking? – Amani Aug 10 '13 at 12:07
  • 1
    Have you tried searching the file on your entire drive using a command prompt? If you use the open-source version of Qt, static linking is against the license. – huysentruitw Aug 10 '13 at 12:11
  • 2
    They may be find in `QTDIR\5.1.0\mingw48_32\bin` (QTDIR is the directory you install Qt5) if you install Qt5.1.0. Beside them, you may need some dlls in `QTDIR\5.1.0\mingw48_32\plugins` too. – newkedison Aug 10 '13 at 12:12
  • @newkedison : yes the Qt5Core.dll is there the directories you mentioned. – Amani Aug 10 '13 at 12:15
  • @WouterHuysentruit: I am facing the same problem as asked by @Amani. I resolved the errors related to `.dll files missing` by copying the .dll files to the release directory where my .exe file is present. **Now when I run the .exe file I dont see any more errors that .dll is missing, unfortunately am unable to see my application come up. I checked the running processes on my windows 7 machine and I see my application .exe file listed in the processes.** Is there something else that am missing here ? Any help is appreciated thanks. – user12345 May 09 '16 at 07:50
  • @user12345 I suggest you start a new question – huysentruitw May 11 '16 at 17:14
  • 2
    @user12345 use the standard Qt Windows deployment tool (`windeployqt`), instead of copying DLLs manually, because it is not guaranteed to work otherwise. `windeployqt` does some additional magic under the hood apart from actually copying the DLLs. See this answer for more details: http://stackoverflow.com/a/33292008/504611 – Vicky Chijwani May 31 '16 at 09:33
  • @VickyChijwani i did follow your advice on using `windeployqt`, but i got an error "procedure entry point could not be located _ZNSt18condition_variable4waitERSt11unique_locklSt5mutexE on qt5cored.dll" already tryied using --debug and --relase flag with no avail, any idea what it might be? already check this https://stackoverflow.com/questions/52121074/qt5-deployment-procedure-entry-point-could-not-be-located – lightshadown Jul 23 '20 at 00:38
  • @lightshadown Sorry I haven't worked with Qt in over 4 years now... – Vicky Chijwani Jul 23 '20 at 20:54
11

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
Micha Wiedenmann
  • 19,979
  • 21
  • 92
  • 137
Bonga the Poo
  • 121
  • 1
  • 4
2

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.

Mujeeb Ishaque
  • 2,259
  • 24
  • 16
1

For the solution what you need to do is to copy the path of the bin folder in your installed Qt creator. Mine was D:\QTCreator\5.12.10\mingw73_64\bin and then paste it in the Environment variable of your computer (which can be found in your advanced system settings of your PC)

0

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.

framontb
  • 1,817
  • 1
  • 15
  • 33
0

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

0

If you have installed Qt Creator you have the missing dlls. Mine were at C:\Qt\5.15.2\mingw81_64\bin. I added the path to my environmental variables and my executable now works. This solution allows you to move your application around without moving dlls.

Keith
  • 49
  • 5