以下各个库都包含了C Run-Time Libraries functions,他们的区别和编译选项以及打开的预编译开关如下:
C run-time library (without iostream or standard C++ library) | Characteristics | Option | Preprocessor directives |
---|---|---|---|
LIBC.LIB | Single-threaded, static link | /ML | |
LIBCMT.LIB | Multithreaded, static link | /MT | _MT |
MSVCRT.LIB | Multithreaded, dynamic link (import library for MSVCR71.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP71.DLL to run. | /MD | _MT, _DLL |
LIBCD.LIB | Single-threaded, static link (debug) | /MLd | _DEBUG |
LIBCMTD.LIB | Multithreaded, static link (debug) | /MTd | _DEBUG, _MT |
MSVCRTD.LIB | Multithreaded, dynamic link (import library for MSVCR71D.DLL) (debug) | /MDd | _DEBUG, _MT, _DLL |
在VS中对应的编译选项截图: