Qt4 with Visual Studio and static C runtime
From qtnode
Start off by following the directions is Qt4 with Visual Studio.
(Note: These instructions are known to work with MS Visual Studio 2005 and Qt 4.1.3. If you are using another version, things may be slightly different. See also Trolltech's knowledgebase: Why does a statically built Qt use the dynamic Visual Studio runtime libraries? Do I need to deploy those with my application?)
- run qconfigure with -static
- edit qmake.conf
For MS Visual Studio 2005, you would change the following file: {WhereverYourQtIsInstalled}\mkspecs\win32-msvc2005\qmake.conf.
changeQMAKE_CFLAGS_RELEASE = -O2 -MD
to:QMAKE_CFLAGS_RELEASE = -O2 -MT
changeQMAKE_CFLAGS_DEBUG = -Od -ZI -Gm -MDd
to:QMAKE_CFLAGS_DEBUG = -Od -ZI -Gm -MTd
changeCONFIG += 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
- run nmake sub-src