I\'m absolutely new to Qt. I\'ve made a program using C++ in Visual Studio 2010 in which I use the external library from Dcmtk. I now want to add a user interface to that pr
since Qt 5, adding to your qmake build script *.pro file, a configuration like:
CONFIG += static_runtime
will cause qmake to include the mkspecs/features/static_runtime.prf file, which should contain the required configurations, something like below:
msvc {
# -MD becomes -MT, -MDd becomes -MTd
QMAKE_CFLAGS ~= s,^-MD(d?)$, -MT\1,g
QMAKE_CXXFLAGS ~= s,^-MD(d?)$, -MT\1,g
} else: mingw {
QMAKE_LFLAGS += -static
}
but as advance warning, note that this may cause some link errors, which make an statement like
"MSVCRT.lib(MSVCRxxx.dll) : error LNK2005: xxx already defined in LIBCMTD.lib(xxx.obj)", basically because other libraries that you are using are linked with the dynamic CRT library (i.e. they are NOT build with /MT or /MTd flag, and you would need to rebuild them with the appropriate flag), for more see this question.