An attempt to create a debugging library that uses precompiled headers may fail, and fatal build errors may be generated (102697)
The information in this article applies to:
- Microsoft Visual C++ 1.0
- Microsoft Visual C++ 1.5
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52
- Microsoft Visual C++ 2.0
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 2.2
- Microsoft Visual C++ 4.1
- 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++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ 2005 Express Edition
This article was previously published under Q102697 SYMPTOMS An attempt to create a debugging library that uses
precompiled headers may fail and fatal build errors may be generated. With the
16-bit edition, the CVPACK and LINK utilities may generate the following error
message: CVPACK : fatal error CK1017: cannot find
precompiled types file; relink with file.obj LINK : warning LNK4027:
CVPACK error With the 32-bit edition, the LINK utility may generate
the following error message: LINK : fatal error LNK1211:
precompiled type information not found; "<filename>" not linked or
overwritten Note If you build a static library in a Visual Studio .NET version
with precompiled header file, and you use the compiler debug switches /ZI or
/Zi, you may not receive the errors that are listed in this article, but you
may see either of the following two problems while debugging your application
and trying to view any variables from the library in the Watch window:
The resolution for this debugging problem is the same as is
described in the "Resolution" section of this article. CAUSE When you specify the /Yc and /Z7 options on the compiler command line, Microsoft C/C++ generates a
precompiled header file that contains CodeView debugging information. The error
occurs only when you store the precompiled header in a library, use the library
to build an object module, and the source code does not refer to any of the
functions the precompiled header file defines.
RESOLUTION There are two methods to work around this situation, as
follows:
- Specify the /Yd compiler option switch to add the CodeView information from the
precompiled header to each object module. This method is less desirable because
it generally produces large object modules that can increase the time required
to link the application.
- Note The following work-around is for 32-bit versions only. Specify
the /Yl<symbol> compiler option switch, where <symbol> is the name of an arbitrary symbol in the library, when you
create a precompiled header file that does not contain any function
definitions. This switch directs the compiler to store the debugging
information in the precompiled header file.
STATUS This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 12/9/2005 |
---|
Keywords: | kberrmsg kbtshoot kbCompiler kbprb KB102697 kbAudDeveloper |
---|
|