
In this tutorial, I’ll tell you in pictures how to build an application statically / to do a static link / wean your * .exe from Qt libraries - it seems that it’s all the same
Entry :
Personally, I was doing everything with the fresh one at the moment Qt SDK from the Nokia website (Qt 4.8 and SDK 1.2.1)
I myself am a complete noob on Windows, since I’m sitting on Linux all my life, so everything is accompanied by pictures, for the same noobs in Windows like me.
')
Step 1.As far as I figured out for normal assembly, we will need Perl in the system.
I took it
from here
Then, as I understand it, a terrible mess is created in Windows with where the variables are stored and you need to manually enter some variables, in short a tick on the screen should save all this insanity, so I advise you to leave it

Hurray, we have Perl!
Step 2.Now you can start building Qt from sources.
First of all, I suggest downloading the source code.
I took these, and maybe even a fresher suit, but I did not take the risk
Now you need to unpack this case in X: \ QtSDK \ QtSources \ 4.7.4 \
you will not have QtSources \ 4.7.4 \ folders, you need to create them

Now we need to open your favorite notepad file
X: \ QtSDK \ QtSources \ 4.7.4 \ mkspecs \ win32-g ++ \ qmake.conffind the line containing the text:
QMAKE_LFLAGSand bring it to this kind of mind:
QMAKE_LFLAGS = -static -static-libgcc -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
and save the file.

Now we need to open the patched terminal (forgive me if the thing is not so called), which can be found at home by looking at my screenshot

Now in this terminal we need to go to the directory
X: \ QtSDK \ QtSources \ 4.7.4 \and score a team
configure -static -debug-and-release -no-exceptions -openssl-linked -nomake demos -nomake examples

then you have to read everything that you will be offered to read and correctly answer questions
waiting for the command to complete (end of configuration) and the appearance of the input line prompt, we now hammer in the command (build the library)
mingw32-make sub-src
after the terminal you can close and do the following


after clicking "Collect All" can fall out such an incomprehensible thing at first glance, I suggest simply closing it and forgetting about it

Everything is almost ready, it remains to open your project and make a few clicks, as in the screenshots


Thank you all for your attention, I hope everything worked out for you.
I hope this lesson will serve as a layout for a more subtle assembly and configuration of your Qt environment.