c++ - 尝试在 Visual C++ 中使用 CString 时出现语法错误

标签 c++ c visual-studio visual-c++ cstring

我的项目对包含 cstring 不满意。它会产生如下错误:

    Error   10  error C2061: syntax error : identifier 'using'  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring  18  1   fgdll
    Error   95  error C2061: syntax error : identifier 'tanhf'  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath    26  1   fgdll
    Error   93  error C2061: syntax error : identifier 'tanf'   C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath    26  1   fgdll
    Error   51  error C2061: syntax error : identifier 'strxfrm'    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring  26  1   fgdll
    Error   49  error C2061: syntax error : identifier 'strtok' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring  26  1   fgdll
    Error   47  error C2061: syntax error : identifier 'strstr' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring  25  1   fgdll
...

我该如何解决这个问题?

最佳答案

好的,试试这个:

右键单击每段代码并转到:

属性 > C/C++ > 高级 > 编译为 并检查 编译为 C++ 代码(/TP)

关于c++ - 尝试在 Visual C++ 中使用 CString 时出现语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12783012/

相关文章:

visual-studio - 在Visual Studio中,/mtd和/mdd(在代码生成属性部分中)有什么区别

C++:错误 LNK2019:函数 _main 中引用了未解析的外部符号

c - 将指针传递给结构数组

c - 了解布隆过滤器

c - 在 sprintf() 之前解析并替换 NaN 值

c# - 如何解决警告 "Referenced assembly targets a different processor than the application"

C++ SDL 段错误(核心转储)

c++ - lambda 的类型是什么?

c++ - Lotus Notes Automation:Notes.NotesSession 没有实现 Domino::ISession?

visual-studio - 双击文件时如何强制 Visual Studio 2008 使用 Open 实例?