Answer the question
In order to leave comments, you need to log in
How to build a static exe for windows using Qt
Hello, I am writing a small program and ran into a problem - how to compile a program under Qt into one exe file. Well, or what kind of DLL should be put in the distribution kit so that it works on other computers.
Locally, it works if the folder with the EXE file contains
icudt49.dll
icuin49.dll
icuuc49.dll
libEGL.dll
libGLESv2.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
And this is all pulled from the forums (without libEGL.dll it just silently closes)
However, it refuses to work on other computers. The debug version seems to require vc-redist, but after installing the latter it doesn't work anyway.
The program is elementary, a couple of windows, no special libraries are used.
How to build an exe with static linking?
Answer the question
In order to leave comments, you need to log in
For static linking, you must first build Qt itself from source by configuring it with the -static option. In the readme and on the project website, this is quite clearly described. But in this case, problems with plugins and QtQuick may come out.
If the task does not have to be statically assembled, but simply run on another computer, then in addition to direct DLL dependencies, you must also create a platforms subdirectory next to the EXE file and copy the qwindows.dll plugin there from the <Qt>\qtbase\plugins\platforms\ directory. If the program uses some other plugins, similarly, you will need to copy them to the appropriate subdirectories.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question