0
votes

I have a program written in C++ which is compiled with Visual Studio 2013. It also uses Qt5. I can start the program from Visual Studio (debug/release), but if I try to start the .exe file outside of VS nothing happens. My assumption was that it's missing DLL files. According to "dumpbin /dependents" I need these DLLs:

File Type: EXECUTABLE IMAGE

Image has the following dependencies:

Qt5OpenGL.dll
Qt5Gui.dll
Qt5Widgets.dll
Qt5Core.dll
MSVCP120.dll
MSVCR120.dll
KERNEL32.dll
SHELL32.dll

I have those lying in the same directory as the .exe file. I copied msvcp120.dll and msvcr120.dll from "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x86\Microsoft.VC120.CRT" and the Qt5 DLLs from "C:\Qt\5.4\msvc2013\bin".

What am I doing wrong? I'm new to C++, so I'm probably missing some knowledge here.

1
Two hints: Firstly, use "dependencywalker" on the executable. Secondly, open a commandline, CD to that directory and run it from there. That should at least give you some error messages, unless the program starts and immediately terminates, which is also a possibility.Ulrich Eckhardt
is it running if you go into the task manager and look at processes?NathanOliver
It's not in the task manager. And running it from the command line in the folder of the .exe has no effect, it immediately goes back to the command line.John
@Torben do you have any "Debugging" arguments in Visual Studio? Right click the project->Properties->Configuration Properties->Debugging and check "Command Arguments"manatttta
No, the arguments are empty. "Dependency Walker" shows the same DLLs. It shows some errors, though because Qt5Widgets.dll seems to be dependent on some DLLs I don't even have on my system. But it works in VS2013...John

1 Answers

0
votes

My .exe was missing 3 DLLs: icudt53.dll, icuin53.dll, icuuc53.dll. "Dependency Walker" was actually showing them as missing, but I misinterpreted what it meant and thought they aren't on my system at all. But they can be found in $(QTDIR)\bin and my VS project added that path to the PATH variable, so in VS the DLLs weren't missing.

EDIT: It's actually way easier just to do this from the command line:

windeployqt C:\Path\To\My.exe

It will copy all needed DLLs into the .exe folder. It's even more DLLs than I thought. For example "qwindows.dll" is needed if you want to deploy the program on a machine without Qt.