The information in this article applies to:
SYMPTOMSCase OneWhen compiling a file that uses the Standard Template Library (STL), you may see the following warning and error when using the std namespace, which is required when using the STL with MFC:
Case TwoIn addition, you may get this different set of errors:
Case ThreeOnce the previous two cases are resolved, you may get link errors. The errors you may receive take this form: Here SymbolName is a C Run-Time (CRT) symbol prefaced by the std:: namespace name. RESOLUTION
Warning C4114 is superfluous and can be ignored. You can disable the
warning by using a '#pragma warning' directive. Error C2661 requires that
you include New.h in your source file.
Including New.h will work around this problem as well. Note that these
definitions are no longer necessary in MFC code and can be deleted.
The third set of errors from the linker can be resolved by including the appropriate header files from the CRT above the declaration for the std namspace. You can determine which header file must be included by looking at the symbol listed in the linker error. Remove the leading std:: from the symbol, and then search for the symbol in the CRT header files. This file was included by the STL headers. You need to include this header explicitly before the namespace declaration. In the Case Three Sample Code section in this article, you can see Iostream.h is the header that must be included at global scope. STATUSThis behavior is by design. MORE INFORMATIONSample Code to Reproduces Behavior Described in Case One
Sample Code to Reproduces Behavior Described in Case Two
Sample Code to Reproduces Behavior Described in Case three
Additional query words: MFC
Keywords : kberrmsg STLIss |
Last Reviewed: July 27, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |