Every Visual C++ project is linked with a C run-time library. This is called the CRT in Microsoft literature.
Depending on the support for multi-threading there are 2 kinds of CRT:
- Single threaded CRT: This can only be statically linked. This CRT is used if one of the compiler options
/ML
or/MLd
is specified. It would be linked withlibc.lib
orlibcd.lib
respectively for Release and Debug modes. The single-threaded CRT is completely deprecated and should not be used! - Multi-threaded CRT: This is the default kind of CRT and should be used always.
The type of linking (static or dynamic) and the configuration (Release or Debug), lead to 4 kinds of multi-threaded CRT:
- Release mode and statically linked: Specified using the compiler option
/MT
. The library file used islibcmt.lib
. - Debug mode and statically linked: Specified using the compiler option
/MTd
. The library file used islibcmtd.lib
. - Release mode and dynamically linked: Specified using the compiler option
/MD
. The library file used ismsvcrt.lib
and the DLL file used at run-time ismsvcr100.dll
(depends on Visual C++ version). - Debug mode and dynamically linked: Specified using the compiler option
/MDd
. The library file used ismsvcrtd.lib
and the DLL file used at run-time ismsvcr100d.dll
(depends on Visual C++ version).
Reference: C Run-Time Libraries at MSDN.
