发布时间:2014-7-15 14:55
分类名称:C++
C Run-Time Libraries (CRT)
The following libraries contain the C run-time library functions.
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 (imp | _MT, _DLL | |
libcmtd.lib | None, static link | Multithreaded, static link (debug) | /MTd | _DEBUG, _MT |
msvcrtd.lib | msvcr110d.dll | Multithreaded, dynamic link (imp | /MDd | _DEBUG, _MT, _DLL |
msvcmrt.lib | None, static link | C Runtime static library. Used for mixed managed/native co | /clr /clr:oldSyntax |
|
msvcurt.lib | None, static link | C Runtime static library compiled as 100% pure MSIL co | /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. See Multithreaded Libraries Performance. |
If you link your program from the command line without a compiler option that specifies a C run-time library, the linker will use LIBCMT.LIB. This is different from previous versions of Visual C++ which used LIBC.LIB, the single-threaded library, instead.
Using the statically linked CRT implies that any state information saved by the C runtime library will be local to that instance of the CRT. For example, if you use strtok, _strtok_l, wcstok, _wcstok_l, _mbstok, _mbstok_lwhen using a statically linked CRT, the position of the strtok parser is unrelated to the strtok state used in co
Because a DLL built by linking to a static CRT will have its own CRT state, it is not recommended to link statically to the CRT in a DLL unless the consequences of this are specifically desired and understood. For example, if you call _set_se_translator in an executable that loads the DLL linked to its own static CRT, any hardware exceptions generated by the co
If you are using the /clr compiler switch, your co
If you are using the /clr:pure compiler switch, your co
For more information on using the CRT with /clr, see Mixed (Native and Managed) Assemblies; for /clr:pure, see Pure and Verifiable Co
To build a debug version of your application, the _DEBUG flag must be defined and the application must be linked with a debug version of on
This version of Visual C++ is not conformant with the C99 standard.
Standard C++ Library
Standard C++ Library | Characteristics | Option | Preprocessor directives |
LIBCPMT.LIB | Multithreaded, static link | /MT | _MT |
MSVCPRT.LIB | Multithreaded, dynamic link (imp | /MD | _MT, _DLL |
LIBCPMTD.LIB | Multithreaded, static link | /MTd | _DEBUG, _MT |
MSVCPRTD.LIB | Multithreaded, dynamic link (imp | /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.
When you build a release version of your project, on
#include <ios>
What is the difference between msvcrt.dll and msvcr110.dll?
The msvcrt.dll is now a "known DLL," meaning that it is a system component owned and built by Windows. It is intended for future use on
What problems exist if an application uses both msvcrt.dll and msvcr110.dll?
If you have a .lib or .obj file that needs to link to msvcrt.lib, then you should not have to recompile it to work with the new msvcrt.lib in Visual C++. The .lib or .obj file may rely on the sizes, field offsets, or member function names of various CRT classes or variables, and those should all still exist in a compatible way. When you relink against msvcrt.lib, your final EXE and DLL image will now have a dependency on msvcr110.dll instead of msvcrt.dll.
If you have more than on
If your program is using more than on