Deploying Qt 5.6 on Windows problem
-
I updated from Qt 5.4 to Qt 5.6 and wanted to deploy my application as I did so many times before using the
windeployqt
tool. I never had issues with it and everything worked out of the box but not this time. I can't figure out what the issue is or how to fix it so any help would be highly appreciated.I'm using Qt 5.6 with MinGW 4.9.2 32-bit on a Windows 10 64-bit machine. After I run
windeployqt
I get the expected result:
However, when I double-click the executable I get the following error:The program can't start because libgcc_s_dw2-1.dll is missing from your computer.
. Fair enough, I manually copy that file fromC:\Qt\5.6\mingw49_32\bin
to the directory and then I get the next error:The application was unable to start correctly 0xc000007b
. And this is where I am completely lost. Starting the executable from the terminal doesn't give any debug message. It just doesn't do anything.Can anybody help me with that? I am completely lost.
-
Hi, guessing you have Code::Blocks installed? (or something similar installed on May 11th).
it's possible you have 2 different (one 32-bit and one 64-bit) versions of MinGW installed. The file libgcc_s_sjlj-1.dll shouldn't be there (it doesn't like to be together with libgcc_s_dw2-1.dll) see more here](http://www.sfml-dev.org/tutorials/2.3/start-cb.php) -
Hi, guessing you have Code::Blocks installed? (or something similar installed on May 11th).
it's possible you have 2 different (one 32-bit and one 64-bit) versions of MinGW installed. The file libgcc_s_sjlj-1.dll shouldn't be there (it doesn't like to be together with libgcc_s_dw2-1.dll) see more here](http://www.sfml-dev.org/tutorials/2.3/start-cb.php)@hskoglund Thank you for your reply.
I don't have Code::Blocks installed but I have other MinGW versions (through cygwin) on my system. However libgcc_s_sjlj-1.dll was copied to that directory by thewindeployqt
tool. I assume that it pulls the correct files from the MinGW distribution that comes with the Qt installation (the one fromC:\Qt\5.6\mingw49_32\bin\
).Anyway, I removed the file but the issue remains. How do I make sure that I get the proper version of the DLLs (32-bit vs. 64-bit)? I assumed that
windeployqt
would take care of all of this. -
Hmm
windeployqt
can get confused where to pick up the compiler dlls.Looking at the MinGW files in your listing, these 2 important ones have the wrong date/time and size:
libstdc++-6.dll
libwinpthread-1.dll
(the other 2 libEGL.dll, libGLESV2.dll and opengl32sw.dll are correct).Try do the same with libstdc++-6.dll and libwinpthread-1.dll as you did with libgcc_s_dw2-1.dll, i.e. copy them manually from
C:\Qt\56.\mingw49_32\bin
-
Hmm
windeployqt
can get confused where to pick up the compiler dlls.Looking at the MinGW files in your listing, these 2 important ones have the wrong date/time and size:
libstdc++-6.dll
libwinpthread-1.dll
(the other 2 libEGL.dll, libGLESV2.dll and opengl32sw.dll are correct).Try do the same with libstdc++-6.dll and libwinpthread-1.dll as you did with libgcc_s_dw2-1.dll, i.e. copy them manually from
C:\Qt\56.\mingw49_32\bin
Well now it's actually working.
Thank you very much, I appreciate your help a lot!Is there any way to tell
windeployqt
to only pick the DLLs from the MinGW distribution that came as part of the Qt installation? It seems to be a "pointless tool" otherwise (to exaggerate a bit). -
Well now it's actually working.
Thank you very much, I appreciate your help a lot!Is there any way to tell
windeployqt
to only pick the DLLs from the MinGW distribution that came as part of the Qt installation? It seems to be a "pointless tool" otherwise (to exaggerate a bit).@Joel-Bodenmann Just an FYI for people that may stumble upon this topic.
windeployqt
picks the DLLs based on thePATH
environment variable. That means putting$QT_INSTALL_DIR\Tools\mingw810_64\bin\
instead ofC:\MinGW\bin
will lead towindeployqt
picking the DLLs that come with Qt. This approach requires removing theC:\MinGW\bin
path from the environment variable. If you need to keep it there, maybe just put them both there and play with the order. -
@Joel-Bodenmann Just an FYI for people that may stumble upon this topic.
windeployqt
picks the DLLs based on thePATH
environment variable. That means putting$QT_INSTALL_DIR\Tools\mingw810_64\bin\
instead ofC:\MinGW\bin
will lead towindeployqt
picking the DLLs that come with Qt. This approach requires removing theC:\MinGW\bin
path from the environment variable. If you need to keep it there, maybe just put them both there and play with the order.Here's my shell script for setup in git bash (mingw)
#!/bin/bash # use " source ./setup.sh " to execute export PATH=/c/Qt/5.15.2/mingw81_64/bin:$PATH export PATH=/c/Qt/Tools/mingw810_64/bin:$PATH export PATH=/c/Qt/Tools/QtInstallerFramework/4.1/bin:$PATH