C Run-Time Libraries
The following table lists the release versions of the C run-time library files, along with their associated compiler options and environment variables. Prior to Visual C++ 4.2, the C run-time libraries contained the iostream library functions. In Visual C++ 4.2 and later, the old iostream library functions have been removed from LIBC.LIB, LIBCMT.LIB, and MSVCRT.LIB. (This change was made because the Standard C++ library has been added to Visual C++, and it contains a new set of iostream libraries. Thus, two sets of iostream functions are now included in Visual C++.) The old iostream functions now exist in their own libraries: LIBCI.LIB, LIBCIMT.LIB, and MSVCIRT.LIB. The new iostream functions, as well as many other new functions, exist in the Standard C++ libraries: LIBCP.LIB, LIBCPMT.LIB, and MSVCPRT.LIB.
The Standard C++ library and the old iostream library are incompatible, and only one of them can be linked with your project. See Port to the Standard C++ Library and the for details.
When you build a release version of your project, one of the basic C run-time libraries (LIBC.LIB, LIBCMT.LIB, and MSVCRT.LIB) is linked by default, depending on the compiler option you choose (single-threaded, multithreaded, or DLL). Depending on the headers you use in your code, a library from the Standard C++ libraries or one from the old iostream libraries may also be linked:
- If you include a in your code, a Standard C++ library will be linked in automatically by Visual C++ at compile time. For example:
#include <ios>
- If you include an old iostream library header, an old iostream library will be linked in automatically by Visual C++ at compile time. For example:
#include <ios.h>
Note that headers from the Standard C++ library and the old iostream library cannot be mixed.
Headers determine whether a Standard C++ library, an old iostream library, or neither will be linked. Compiler options determine which of the libraries to be linked is the default (single-threaded, multithreaded, or DLL). When a specific library compiler option is defined, that library is considered to be the default and its environment variables are automatically defined.
C Run-Time Library (without iostream) | Characteristics | Option | Defined |
LIBC.LIB | Single threaded, static link | /ML | |
LIBCMT.LIB | Multithreaded, static link | /MT | _MT |
MSVCRT.LIB | Multithreaded, dynamic link (import library for MSVCRT.DLL) | /MD | _MT, _DLL |
Standard C++ Library | Characteristics | Option | Defined |
LIBCP.LIB | Single threaded, static link | /ML | |
LIBCPMT.LIB | Multithreaded, static link | /MT | _MT |
MSVCPRT.LIB | Multithreaded, dynamic link (import library for MSVCRT.DLL) | /MD | _MT, _DLL |
Old Iostream Library | Characteristics | Option | Defined |
LIBCI.LIB | Single threaded, static link | /ML | |
LIBCIMT.LIB | Multithreaded, static link | /MT | _MT |
MSVCIRT.LIB | Multithreaded, dynamic link (import library for MSVCIRT.DLL) | /MD | _MT, _DLL |
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 one of these libraries. For more information about using the debug versions of the library files, see C Run-Time Debug Libraries.