Select the product you need help with
Description of the default C and C++ libraries that a program will link with when built by using Visual C++Article ID: 154753 - View products that this article applies to. This article was previously published under Q154753 On This PageSUMMARY This article describes the default libraries LIBC[D].LIB,
LIBCMT[D].LIB, LIBCI[D].LIB, LIBCIMT[D].LIB, LIBCP[D].LIB, LIBCPMT[D].LIB,
MSVCRT[D].LIB, MSVCIRT[D].LIB, and MSVCPRT[D].LIB that a program will link with
when built using Visual C++. MORE INFORMATION When you build a release (or debug) version of your project
in Visual C++, one of the basic C Runtime libraries (LIBC[D].LIB,
LIBCMT[D].LIB, and MSVCRT[D].LIB) is linked by default, depending on the
compiler option you choose (single-threaded <ML[d]>, multithreaded
<MT[d]>, or multithreaded DLL<MD[d]>). A library from the Standard
C++ Library or one from the old iostream library may also be linked depending
on the headers you use in your code. For example, consider the following cases:
Case 1: Sample program test1.cpp
Case 2: Sample program test2.cpp
Case 3: Sample program test3.cppNote The stream header files that have the .h extension (include <useoldio.h>) have been deprecated in Visual C++ 2002 and have been removed in Visual C++ 2005 and in Visual C++ 2003. Therefore, the following sample will not work in a version of Visual C++ later than Visual C++ 2002.
Note It may seem that headers without the .h extension are Standard C++ headers and that headers with the .h extension are C Runtime headers or old iostream headers. This is not true. As explained below, the files <useoldio.h> and <use_ansi.h> determine the libraries your application will link with. Actually, there are two header files, <useoldio.h> and <use_ansi.h>, that contain #pragmas. The #pragmas force either the old iostream library or the Standard C++ library to be linked in by default. The header file <useoldio.h> contains #pragma statements, which force the old iostream library to be linked in. All old iostream headers include <useoldio.h>. So, if you include any old iostream header in your application, the old iostream library will be linked by default. The following table lists all the header files that include <useoldio.h>. Old iostream headersCollapse this table
Note <useoldio.h> applies only to Visual C++ .NET 2003 and earlier versions. Because the old iostream library was removed from Visual C++ 2003 and later versions, the <useoldio.h> header was also removed. The header file <use_ansi.h> contains #pragma statements
that force the Standard C++ Library to be linked in. All Standard C++ Headers
include <use_ansi.h>. So if you include any Standard C++ header in your
application, the Standard C++ library will be linked by default. The following
table lists all the header files that include <use_ansi.h>. Standard C++ HeadersCollapse this table
Collapse this table
Summary Table for CRT DLLs UsedCollapse this table
REFERENCESC Run-Time Libraries
http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
(http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx)
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
154419
(http://support.microsoft.com/kb/154419/
)
Standard C++ Library frequently asked questions
PropertiesArticle ID: 154753 - Last Review: March 19, 2008 - Revision: 7.1 APPLIES TO
| Article Translations
|


Back to the top








