How to determine default libraries for an .obj object file in Visual C++ (143072)
The information in this article applies to:
- Microsoft Visual C++ 2.0
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 2.2
- Microsoft Visual C++ 4.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
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.
Modification Type: | Major | Last Reviewed: | 1/9/2006 |
---|
Keywords: | kbDebug kbhowto KB143072 kbAudDeveloper |
---|
|