3

I want to give a friend of mine a release build of a little project. It works perfectly fine when started from inside qtcreator, but doesn't open when double-clicked on the .exe file. It doesn't even give me an error message.

Now when I tried to copy a few Qt .dll files (like Qt5Core.dll, Qt5Gui.dll, Qt5Widgets.dll) next to my exe file, it didn't change anything. How can I know what dependencies my project has? The .pro file doesn't tell me so much

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = project1
TEMPLATE = app


SOURCES += main.cpp\
    mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

I'm working on Windows 7 (64 bit), Qt Creator 2.6.1 based on Qt 5.0.0 (32 bit)

thanks for any help Sadik

edit: solution can be seen in my answer

Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
Sadık
  • 4,249
  • 7
  • 53
  • 89
  • 2
    Start it from console to see potential errors printed, check out http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx . Use dependency walker (http://www.dependencywalker.com) to check for DLL dependencies. Make sure the MSVC or mingw runtime is installed on the target system. (Depending on which compiler you're using). – Frank Osterfeld Jan 26 '13 at 14:29
  • Nothing happens when started from console. I'm using MSVC. Is it possible that the release runs in qtcreator without MSVC being installed correctly? Using dependencywalker gives me an error next to "gpvcs.dll" : Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. – Sadık Jan 26 '13 at 15:10

4 Answers4

4

Solved it! All I had to do was to download "libEGL.dll" and put it in the directory where my exe file is located. Of course all the other .dll files from qt were needed, too. But these were explicitly mentioned in an error message. But for the "libEGL.dll" there is not even an error message. The .dll files that were listed in "dependency walker" can be ignored. For my problem this tool didn't really help. It didn't list the libEGL.dll but listed other .dll files which are in fact unused.

Sadık
  • 4,249
  • 7
  • 53
  • 89
  • 1
    You shouldn't need to download these DLLs. They should be in the Qt bin directory. Normally ``C:\Qt\Qt5.0.0\5.0.0\msvc2010\lib`` when using the VS 2010 installer. – Wiz Jan 27 '13 at 07:42
2
How can I know what dependencies my project has?

You can use program Dependency Walker from official site to see what dll's your program need.

NB Use Qt dlls of the same version (if you use Qt5, find your dlls from Qt5's bin directory and so on).

NG_
  • 6,895
  • 7
  • 45
  • 67
  • Dependency Walker gives me an error next to "gpvcs.dll" : Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. I only have gpvcs.dll for 64bit. If I copy it in the directory where my exe file is, it gives me the same error message for SYSNTFY.DLL – Sadık Jan 26 '13 at 15:20
  • After downloading x86 dll files and putting them into the directory, I only get one warning in Dependency Walker: Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. - I still don't get any message when dclicking on the exe file – Sadık Jan 26 '13 at 17:27
2

Since you are talking about Qt5, make sure you have a platforms directory with at least qminimal.dll in it location in the directory of your program.exe file. They are part of the new changes made to Qt. (Possibly qwindows.dll as well).

Additionally, make sure you include the appropriate msvcr*.dll dlls if you do no compile with it statically linked. Check with dependency walker.

/myProgram.exe 
/Qt5Gui.dll
/Qt5Core.dll
/ .... (other DLLs you require)
/platforms/qminimal.dll
/platforms/qwindows.dll (Not always required)
Wiz
  • 2,145
  • 18
  • 15
1

What compiler are you using? You need to bundle the runtime DLL files for the compiler or have the user install the Microsoft Visual C++ Redistributable Package if you're using MSVC++.

Daniel Hedberg
  • 5,677
  • 4
  • 36
  • 61