[ Solution ]
I want to run my app created with QtSDK
on a machine that does not have Qt
installed.
I tried to copy
"microsoft visual c++ runtime library: this application has requested the runtime to terminate it in an unusual way"
That's either an ordinary bug, or sometimes a mix of incompatible dlls
Use the (free) depends program on your exe to check which dlls it actually uses - it probably isn't linking all of Qt
Some Qt libs are loaded at runtime from a plugins folder, mostly image formats and database connections - but they woudln't give this error
To distribute your application you need to copy the DLLs (only the DLLs necessary).
Copy the DLLs necessary from
<DRIVE>:\Qt\Qt<Version_qt>\<Version_qt>\mingw<Version_mingw>\
or <DRIVE>:\Qt\Qt<Version_qt>\<Version_qt>\mingw<Version_mingw>\bin\
eg.: C:\Qt\Qt5.2.0\5.2.0\mingw48_32\
or C:\Qt\Qt5.2.0\5.2.0\mingw48_32\bin
Paste the folder of your application.
Then copy the folders inside of <DRIVE>:\Qt\Qt<Version_qt>\<Version_qt>\mingw<Version_mingw>\plugins
eg.: C:\Qt\Qt5.2.0\5.2.0\mingw48_32\plugins
Paste the folders of your application.
Note: In this example (below), it was necessary to copy DLLs from different places and remove the Debug DLLs (used only to compile in Debug).
Note that the
debug dlls
end with "d.dll", for example: Qt5Core.dll and Qt5Cored.dll or Qt5Concurrent.dll and Qt5Concurrentd.dll, the ending with "d.dll" should not be copied.
The structure should look something like this (example):
Only some DLLs the mingw will be needed, so I recommend using the Dependency Walker 2.2
The result should look like this (not all dlls are needed, this can vary by project type):
Thanks to:
+1 for @MartinBeckett, showed me the program to find the DLLs required.
+1 for @WouterHuysentruit, thanks to the application I indicated, I discovered that the contents of the mingw\plugins folder should go straight into the application folder.
@WouterHuysentruit I would consider your answer as correct, but you just said, so I put a simpler explanation. Thanks anyway.
windeployqt (delivered with QT 5.2+) should do (most?) of the work