Building static Qt on Windows with MSVC

From QtCentreWiki

Jump to:navigation, search
NOTE
See Trolltech's knowledgebase: [1]


Applications built with MSVC depend on msvc*.dll. Following changes must be done to mkspecs in order to eliminate this dependency.

Edit <QTDIR>\mkspecs\win32-X\qmake.conf, where 'X' stands for the version of Visual Studio:

msvc Visual Studio 6
msvc.net Visual Studio.NET 2002-2003
msvc2005 Visual Studio.NET 2005
msvc2008 Visual Studio.NET 2008


1. Change
QMAKE_CFLAGS_RELEASE                      = -O2 -MD
to
QMAKE_CFLAGS_RELEASE                      = -O2 -MT

If the string you find is "-O2 -MD -GL", be sure to remove "-GL" parameter (tested on msvc-2008)

For Versions since 4.3.2

(tested with Qt Open Source 4.3.2, Visual Studio 2005 and Visual Studio 2008)

Additionally change
CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
to
CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target


See also




jpn 22:41, 8 July 2007 (CEST)