Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can't deploy .exe on Windows
kitfox last edited by kitfox
I'm trying to figure out how to create an executable that I can deploy to Windows machines that do not have Qt installed. As a test, I created a new default Qt Widget project. I then compiled release versions for both mingw-32 and MSVC2017 toolkits. I then copied the final .exe file into an empty directory (I used different empty directories for both binaries) and executed the command:
This copied a lot of DLLs into my deployment directory. However, I am still unable to run my executables. The mingw_32 complains that it cannot find
libgcc_s_dw2-1.dlland the MSVC2017 just says that it is unable to start correctly.
If I add
C:\Qt\5.12.3\mingw73_32\binto my PATH then the mingw_32 release will run correctly, but obviously I cannot expect my users to have this on their system.
How can I create a release of this test app?
Pablo J. Rogina last edited by
I cannot expect my users to have this on their system
You need to deploy libgcc_s_dw2-1.dll to the machines you intend to run your mingw built Qt app
kitfox last edited by
@Pablo-J.-Rogina Trouble is, if I include
libwinpthread-1.dllwhich it depends on), I get a bunch of errors about procedure entry points not being found. It also doesn't explain why the MSVC2017 release doesn't work.
Pablo J. Rogina last edited by Pablo J. Rogina
@kitfox beyond deploying those .dll files you mentioned, perhaps you also need to set the PATH properly for (system) files already deployed in the machines that somehow are not being found.
Dependency Walker tool is your friend in cases like this.
I cannot speak regarding MSVC sorry
kitfox last edited by
@Pablo-J.-Rogina Looks like I need to add
libstdc++-6.dllto my deploy directory as well. Seems odd the windeployqt tool would skip these. It would be nice if I could get this working for MSVC as well.
I noticed a few times thats the compilers runtime dlls are not added.
For mingw its libgcc_s_dw2-1.dll and libwinpthread-1.dll and libstdc++-6.dll
Often the visual studio run times DLLS are included in Windows, but for Windows 7
seems not to default have them and one can install
Microsoft Visual C++ 2017(5) Redistributable to get them