Static Linking Windows
-
Recently I inherited a QT project for Windows and Ubuntu.
Eventually after much pain I managed to get an executable for windows.
Unfortunately, when I run the windows exe, I get a popup saying the likes of:
"QT5Gui.dll was not found"All I want is to tell QT Creator or whatever to make a static version of the exe.
How do I do this?
I'm running QTCreator 7 with QT5.12.2 and MSYS2 (mingw 32 bit)I ran windeployqt.exe but it seems bugged as the -v command doesn't work
so I can't tell you which version it is.My second humble request is what arguments do I use on windeployqt?
Also, I read about ./configure -static <some params> unfortunately I can;t find that exe anywhere and it is no where near clear where I get that exe
-
@jsulm Hey thanks mate, i'm downloading the SDK now, another step, hopefully once off.
With a bit of fiddling with windeployqt found that this worked and I could run the application:
windeployqt --release --compiler-runtime <path to your binary>
Thankfully, this dampens the urgency of static builds for the moment as I can just shove it all in an installer.
Thanks for your help
-
@Cambo If you want to use windwployqt you do not need static build.
How to use windeployqt is explained here: https://doc.qt.io/qt-5/windows-deployment.html
-v should work, what happens if you try to use it? Also on Windows try /vIf you want to build statically you first have to build Qt statically as QtCompany does not provide static builds. You can find some hints here: https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
-
@jsulm Hey thanks mate, i'm downloading the SDK now, another step, hopefully once off.
With a bit of fiddling with windeployqt found that this worked and I could run the application:
windeployqt --release --compiler-runtime <path to your binary>
Thankfully, this dampens the urgency of static builds for the moment as I can just shove it all in an installer.
Thanks for your help