# Compiling Qt 5.1.1 static on Windows (XP) with MinGW

• Hi friends ;-)

i am trying to compile Qt 5.1.1 static on my windows xp machine using MinGW.

my configure.bat call is:
@configure.bat -static -prefix C:\Qt\5.1.1-static -qt-sql-sqlite -opengl desktop@

After configure.bat run, i call mingw32-make
and the after some time compilation aborts with error saying uic.exe is missing the library
libgcc_s_sjlj-1.dll

I can not find this library on my machine (i checked also mingw from another installed Qt version)...
But this library doesn't exists at all ....

I found some hints to add @-static-gcc -static-g++@
option into the .pro file...
But which pro file?
I added it into the qt.pro file in Qt source folder but without succsess.

Maybe someone has an idea?

Greetings,
Nando

• Back when I was compiling Qt statically, I edited this file:

qt-everywhere-opensource-src-5.1.1\qtbase\mkspecs\win32-g++\qmake.conf

and added a "-static" to the following variable:

QMAKE_LFLAGS

I haven't tried to compile Qt5 statically, and maybe I changed that file inside the folder containing the MinGW-version I used to compile, not the Qt-sources. So this is only a guess, hope it helps in any way.

• Thanks !!!!
That solves the problem! :)

i just added @-static -static-libgcc@ to QMAKE_LFLAGS in file qt-everywhere-opensource-src-5.1.1\qtbase\mkspecs\win32-g++\qmake.conf

So the lines looks as follows:
@QMAKE_LFLAGS = -static -static-libgcc@

Thank you :)

[quote author="thEClaw" date="1378358941"]Back when I was compiling Qt statically, I edited this file:

qt-everywhere-opensource-src-5.1.1\qtbase\mkspecs\win32-g++\qmake.conf

and added a "-static -static-gcc" to the following variable:

QMAKE_LFLAGS

I haven't tried to compile Qt5 statically, and maybe I changed that file inside the folder containing the MinGW-version I used to compile, not the Qt-sources. So this is only a guess, hope it helps in any way.[/quote]

• Happy to hear that still works. :)