You receive a C2653 or C2039 error message when you try to reference a function from the STD C++ library (243444)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q243444 SYMPTOMS
Attempting to reference a function from the STD C++ library header <cstdlib> using the namespace STD (for example, std::exit(0)) causes the compiler to emit a C2653 or a C2039 (depending upon whether or not namespace "STD" is defined at the point where the error is emitted).
CAUSE
<cstdlib> does not define the namespace "STD". This is contrary to the VC++ documentation, which says:
"Include the standard header <cstdlib> to effectively include the standard header <stdlib.h> within the std namespace."
RESOLUTION
To work around the problem, place the "#include <cstdlib>" in the namespace "STD".
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Major | Last Reviewed: | 5/26/2005 |
---|
Keywords: | kberrmsg kbtshoot kbBug kbCompiler kbCPPonly kbpending KB243444 kbAudDeveloper |
---|
|