Article ID: 143072
Article Last Modified on 1/9/2006
APPLIES TO
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 2.2
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
- Microsoft Visual C++ .NET 2002 Standard Edition
This article was previously published under Q143072
Note Microsoft Visual C++ .NET 2002 and Microsoft Visual C++ .NET 2003
support both the managed code model that is provided by the Microsoft .NET
Framework and the unmanaged native Microsoft Windows code model. The
information in this article applies only to unmanaged Visual C++
code. Microsoft Visual C++ 2005 supports both the managed code model that
is provided by the Microsoft .NET Framework and the unmanaged native Microsoft
Windows code model.
SUMMARY
In Visual C++, default libraries can be linked to
automatically. This is done for the C run-time libraries. The compiler writes a
default C run-time library name in the object (.obj) files it creates. The
library name depends on the compiler options you use.
You can also
specify default libraries by the using the #pragma comment() compiler
directive. The Microsoft Foundation Class (MFC) header files do this.
Writing a default library name in an object file in this manner
saves you from having to specify the library on the linker command line.
However, sometimes it is necessary to determine which libraries an object file
links to by default.
Keywords: kbhowto kbdebug KB143072