尝试在 Visual C++ 中使用 CString 时出现语法错误
Syntax errors when trying to use CString in Visual C++
我的项目对包含cstring
不满意。它会产生以下错误:
Error 10 error C2061: syntax error : identifier 'using' C:Program Files (x86)Microsoft Visual Studio 10.0VCincludecstring 18 1 fgdll
Error 95 error C2061: syntax error : identifier 'tanhf' C:Program Files (x86)Microsoft Visual Studio 10.0VCincludecmath 26 1 fgdll
Error 93 error C2061: syntax error : identifier 'tanf' C:Program Files (x86)Microsoft Visual Studio 10.0VCincludecmath 26 1 fgdll
Error 51 error C2061: syntax error : identifier 'strxfrm' C:Program Files (x86)Microsoft Visual Studio 10.0VCincludecstring 26 1 fgdll
Error 49 error C2061: syntax error : identifier 'strtok' C:Program Files (x86)Microsoft Visual Studio 10.0VCincludecstring 26 1 fgdll
Error 47 error C2061: syntax error : identifier 'strstr' C:Program Files (x86)Microsoft Visual Studio 10.0VCincludecstring 25 1 fgdll
...
如何解决这个问题?
好的,试试这个:
右键单击每段代码并转到:
Properties
> C/C++
> Advanced
> Compile As
并检查Compile as C++ Code(/TP)
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 代码在main()中运行,但在函数中出现错误
- 释放错误后堆使用
- (C++)分析树以计算返回错误值的简单算术表达式
- Project Euler问题4的错误解决方案
- __int64 CString 返回错误的值 - C++ MFC
- CSTRING分配错误
- 尝试在 Visual C++ 中使用 CString 时出现语法错误
- 在将值分配给 CString 时获取<错误 Ptr> 和无效值
- 错误 C2440: 'type cast':无法从 'bool' 转换为 'CString'
- 使用 CString::Format 格式化长值的错误 (??)
- 将 strcpy() 与指向 cstring 的指针一起使用时出现分段错误
- vc++ 6.0中使用CString::AllocSysString时链接错误
- 错误与CString当我导入vc++ 2005