Microsoft KB Archive/83869

{|
 * width="100%"|

PRB: Using Old Include Files May Cause L2029

 * }

Q83869

7.00 | 1.00 MS-DOS | WINDOWS kbtool kbprb -- The information in this article applies to: - Microsoft C/C++ for MS-DOS, version 7.0 - Microsoft Visual C++ for Windows, version 1.0 -- SYMPTOMS ======== When 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 external NOTE: The symbol is a fully qualified function declaration (that is, includes its return type and parameters). CAUSE ===== The 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 &quot;C&quot; { #endif #ifdef __cplusplus // end of file } #endif The include files from earlier versions of C do not specify that &quot;C&quot; linkage should be used, so &quot;C++&quot; 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. RESOLUTION ========== Make 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 KBCategory: kbtool kbprb KBSubcategory: TlsMisc

Keywords : kb16bitonly

Issue type :

Technology : kbVCsearch kbAudDeveloper kbPTProdChange kbvc100 kbZNotKeyword3 kbCVC700DOS