woka

C2059 Error Using extern "C" in .C Source Files

The information to this article applies to:
The Microsoft C/C++ Compiler included with: - Microsoft Visual C++, 32-bit Edition, versions 2.0, 2.1, 2.2, 4.0,

     4.1, 5.0

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 

http://blog.csdn.net/cxyol/archive/2006/10/20/1342650.aspx

posted on 2009-04-28 21:29 woka 阅读(1083) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(2)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜