The information in this article applies to:
SYMPTOMSA template class that contains a static data member of a type that was not pre-defined, such as a struct or a class, causes this error: This error occurs on the line where the static data member is externally declared. RESOLUTIONExplicitly initialize the static data member when it is declared. This may require adding a constructor to the structure (see the sample code). STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Microsoft Visual C++, 32-bit Edition, version 4.0. Sample Code
This code, as shown, generates the error. To work around the problem,
change the line where A() is declared and defined from a comment into an
executed line, and do the same for the = A() on the line where the error is
occurring. This explicitly initializes the data member when it is declared.
Additional query words: 2.00 2.10 2.20 9.0 9.00 9.1 9.10 visualc VC cl
Keywords : kbGenInfo kbLangCPP kbVC |
Last Reviewed: July 27, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |