2

When I run a release build of a program I made in Qt Creator, it says it can't find a DLL. So I added all the DLLs from the Qt bin folder into the program directory, and now the program doesn't come up with an error, but it doesn't start anyways?

I didn't change any of the compiler settings in Qt Creator, what am I doing wrong?

Bill
  • 11,595
  • 6
  • 44
  • 52
killerloader
  • 139
  • 2
  • 10
  • Does the program start when you run it from Qt Creator in Release build? – sashoalm Jan 25 '13 at 08:42
  • I suspect you are talking about Qt Creator, the IDE, and edited the question to reflect that. – rubenvb Jan 25 '13 at 08:43
  • "It doesn't start"? can u show the code? – Didac Perez Parera Jan 25 '13 at 08:45
  • 1
    What kind of project did you run? GUI or console? If it is a console application without keyboard interrupt it might disappear very fast. – janr Jan 25 '13 at 08:47
  • It runs if i start a program by clicking the green arrow in QT creator, it doesn't work if i compile it and open the .exe file from the folder. – killerloader Jan 25 '13 at 08:56
  • Yes, it will not run, because it can't find the qt libs (e.g. libQtCore.so/dll). You either have to compile qt statically as duDE answered, or you extract the libs you need to your executable and append it to your PATH variable. – janr Jan 25 '13 at 09:09
  • See this answer too: http://stackoverflow.com/a/14703874/1717300 – hyde Feb 05 '13 at 10:54

3 Answers3

3

If you are using Qt4, this explains what .DLL files are needed (same document, two links for future-proofing the answer):

If you are using Qt5, it's a bit more complicated (right plugins are required in the right sub-folder under the .EXE directory), and I don't know if there's a document for that written yet...

hyde
  • 60,639
  • 21
  • 115
  • 176
2

Try to compile QT statically:

http://www.qtcentre.org/wiki/index.php?title=Building_static_Qt_on_Windows

Leo Chapiro
  • 13,678
  • 8
  • 61
  • 92
0

I stuck icudt49.dll,icuin49.dll,icuuc49.dll,libEGL.dll,libGLESv2,Qt5Core.dll,Qt5Gui.dll and Qt5Widgets.dll in the same directory as the Exe file, and it works (all these files are needed for it to work) (This is for the release version)

killerloader
  • 139
  • 2
  • 10