C C++
LIBCMT.lib <---> LIBCPMT.LIB
MSVCRT.lib <---> MSVCPRT.LIB
MSVCMRT.lib <---> N/A
MSVCMRT.lib: C Runtime static library. Used for mixed managed/native code.
C Run-Time Libraries (CRT)
C run-time library (without iostream or standard C++ library) | Associated DLL | Characteristics | Option | Preprocessor directives |
---|---|---|---|---|
libcmt.lib | None, static link. | Multithreaded, static link | _MT | |
msvcrt.lib | msvcr110.dll | Multithreaded, dynamic link (import library for MSVCR110.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP110.DLL to run. | _MT, _DLL | |
libcmtd.lib | None, static link | Multithreaded, static link (debug) | /MTd | _DEBUG, _MT |
msvcrtd.lib | msvcr110d.dll | Multithreaded, dynamic link (import library for MSVCR110D.DLL) (debug). | /MDd | _DEBUG, _MT, _DLL |
msvcmrt.lib | None, static link | C Runtime static library. Used for mixed managed/native code. | /clr /clr:oldSyntax |
|
msvcurt.lib | None, static link | C Runtime static library compiled as 100% pure MSIL code. All code complies with the ECMA URT spec for MSIL. | /clr:pure |
|
The single-threaded CRT (libc.lib, libcd.lib) (formerly the/ML or/MLd options) is no longer available. Instead, use the multithreaded CRT. SeeMultithreaded Libraries Performance.
If you are using the /clr compiler switch, your code will be linked with a static library, msvcmrt.lib. The static library provides a proxy between your managed code and the native CRT. You cannot use the statically linked CRT ( /MT or /MTd options) with/clr. Use the dynamically-linked libraries (/MD or/MDd) instead.
This version (VS2013) of Visual C++ is not conformant with the C99 standard.
When /MD is used with _STATIC_CPPLIB defined (/D_STATIC_CPPLIB) it will cause the application to link with the static multithread Standard C++ Library (libcpmt.lib) instead of the dynamic version (msvcprt.lib) while still dynamically linking to the main CRT via msvcrt.lib.
Standard C++ Library
Standard C++ Library | Characteristics | Option | Preprocessor directives |
---|---|---|---|
LIBCPMT.LIB | Multithreaded, static link | /MT | _MT |
MSVCPRT.LIB | Multithreaded, dynamic link (import library for MSVCP110.dll) | /MD | _MT, _DLL |
LIBCPMTD.LIB | Multithreaded, static link | /MTd | _DEBUG, _MT |
MSVCPRTD.LIB | Multithreaded, dynamic link (import library for MSVCP110D.DLL) | /MDd | _DEBUG, _MT, _DLL |
Note LIBCP.LIB and LIBCPD.LIB (via the old/ML and/MLd options) have been removed. Use LIBCPMT.LIB and LIBCPMTD.LIB instead via the/MT and/MTd options.
Should I compile with /MD or /MT?