PRB: C2059 Error Using extern "C" in .C Source Files (133070)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q133070 SUMMARY Use of "extern "C"" in source files that have a .C
extension causes error C2059, and results in this error message:
error C2059:syntax error:'string'
CAUSE In the C language, the string-literal "C" is not
recognized. It is used in C++ to prevent name decoration. RESOLUTION Remove the string-literal "C" in extern declarations, or
use the following in the function declaration:
#ifdef __cplusplus
extern "C"
#endif
STATUS This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kberrmsg kbLangCPP kbprb KB133070 kbAudDeveloper |
---|
|