PRB: Using Old Include Files May Cause L2029Last reviewed: July 17, 1997Article ID: Q83869 |
7.00 | 1.00
MS-DOS | WINDOWS
kbtool kbprb
The information in this article applies to:
SYMPTOMSWhen linking a C++ program, the linker cannot find many of the C run-time routines even though the source files were successfully compiled with Microsoft C/C++ version 7.0 or Visual C++ version 1.0. LINK issues the error:
L2029: 'symbol': unresolved externalNOTE: The symbol is a fully qualified function declaration (that is, includes its return type and parameters).
CAUSEThe include files that come with C/C++ version 7.0 and Visual C++ verison 1.0 use the following code at the beginning and end of the file to ensure proper linkage of C++ code to the C run-time library, whose modules are written in C:
#ifdef __cplusplus // beginning of file extern "C" { #endif #ifdef __cplusplus // end of file } #endifThe include files from earlier versions of C do not specify that "C" linkage should be used, so "C++" linkage is used. This means that the names of the routines are decorated and the linker can't match them to the actual names, hence the L2029 errors.
RESOLUTIONMake sure that the INCLUDE environment variable is set to the directory that contains the include files for the version of the compiler that you are using.
|
Additional reference words: 7.00 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |