Microsoft KB Archive/178512

= FIX: C1001 in Third-Party STL Code Using Visual Studio 97 SP3 =

PSS ID Number: 178512

Article Last Modified on 7/28/2003

-

The information in this article applies to:


 * Microsoft C/C++ Compiler (CL.EXE)

-



This article was previously published under Q178512



SYMPTOMS
If you are using a third-party Standard Template Library (STL) (such as the Hewlett-Packard implementation), and compile after applying Visual Studio 97 Service Pack 3, the following error may be generated:

testerr.cpp bstring.h(2322) : fatal error C1001: INTERNAL COMPILER ERROR

(compiler file 'E:\utc\src\\P2\main.c', line 379)

Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more Information.



RESOLUTION
The following are suggested workarounds:

  Separate the construction and return of a temporary object. In the example below, replace the return statement with the respective commented statements: if (length) {          return basic_string(data+pos, (n > (length-pos)) ?                  (length-pos) : n);

//basic_string bt(data+pos, (n > (length-pos)) ?          //     (length-pos) : n); //return bt; }      else {      return basic_string;// C1001 on this line // basic_string bt; // return bt; }  }                         Use Visual Studio 97 SP2. Instead of using the Hewlett-Packard STL, use the STL provided in Visual C++ 5.0. See any STL sample in the Visual C++ Online documentation for usage information. You may also read the comprehensive information that is provided on the Web at: http://msdn.microsoft.com/library/en-us/vclang98/HTML/LIB_STL.asp.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 6.0 for Windows.

Keywords: kbBug kbCompiler kbfix kbvfp600fix KB178512

Technology: kbAudDeveloper kbCVCComp kbVCsearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.