Static linking for windows
-
Thank You Cezary Tomczak!
this:
[quote author="Cezary Tomczak" date="1291037300"]- I deleted the whole lib/ directory along with fonts and readme.
- I didn't touch bin/ directory, all files are still there
- win32-g++/qmake.conf, I didn't add "DEFINES += QT_STATIC_BUILD"
- also not this: bin\qmake.exe projects.pro QT_BUILD_PARTS=”libs” JAVASCRIPTCORE_JIT=”yes”
[/quote]
helps me a lot, after days tearing out my hair.
-
Could You Explain Even more on this
[quote author="Gerolf" date="1290842572"]Hi,if all you need is a static build of Qt, done with mingw, do the following:
extract Qt-...-src.zip (that is without any temporary file that mighjt disturb) :)
Change path-to-qt\mkspecs\win32-g++\qmake.conf:
@
QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer
QMAKE_LFLAGS = -static -static-libgcc -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloccd %qtdir%
configure -static -release -no-exceptions -[other parameters like -mmx -sse -sse2 -3dnow etc...]
mingw32-make sub-src [here you can make some coffee etc.. it will take some time]
@If you use webkit, you have to change the webkit pri file also:
\src\3rdparty\webkit\ WebKit.pri:
CONFIG += staticlibFor builds after making the changes in the config files, I used a batch file:
@set QTDIR=D:\Developement\Qt\2010.04\qt_static
set PATH=D:\Developement\Qt\2010.04\qt_static\bin
set PATH=%PATH%;D:\Developement\Qt\2010.04\bin;D:\Developement\Qt\2010.04\mingw\bin
set PATH=%PATH%;%SystemRoot%\System32
set QMAKESPEC=win32-g++mingw32-make confclean
configure.exe -release -confirm-license -qt-libpng -opensource -no-incredibuild-xge -process -static
mingw32-make
@[/quote] -
you can have a look at the wiki: "How to build a static Qt version for Windows with GCC":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc
-
The solution for me is the following currently:
- Download Qt SDK 4.7.0 (4.7.1 - 4.7.3 not working):
ftp://ftp.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.05.exe
(from ftp://ftp.qt.nokia.com/qtsdk)
- Statically build Qt according to instructions:
http://doc.trolltech.com/4.7.1/deployment-windows.html#static-linking
- Statically build your apps according to the above instructions.
I hope these will help you.