c++ - 为什么我们得到构建错误 "error C2065: ' ostringstream' : undeclared identifier"& How to fix this?

标签 c++ visual-studio-2008 visual-c++ iostream ostream

您好,我正在 VS2008 中编译 C++ 解决方案。

 ostringstream      strout; 

我收到编译错误“error C2065: 'ostringstream' : undeclared identifier”。

我觉得我已经包含了所有必要的头文件。

谁能告诉我如何解决这个错误(要包含哪些头文件)?

我还收到一个奇怪的错误,例如 “error C2146: syntax error : missing ';'在同一行的标识符 'strout' 之前。

而我知道我没有错过“;”分号 @ 抛出错误的行。

提前致谢。

最佳答案

你需要

#include <sstream>

并限定名称 std::ostringstream

关于c++ - 为什么我们得到构建错误 "error C2065: ' ostringstream' : undeclared identifier"& How to fix this?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9850527/

相关文章:

c++ - 关于C++函数对象的问题

c - 如何在命令行(Windows)中使用VC++编译器?

windows - 对于超过 32 个内核的系统,如何替换 SetProcessAffinityMask()/GetProcessAffinityMask()?

visual-studio-2008 - 存在哪些其他 TFS 客户端?

c++ - 使用 VC++ 2008 编译引用 STLport-5.1.4 的应用程序时出现 LNK2001 错误

c++ - 我如何强制编译器生成的类的复制构造函数*不*被编译器内联?

C++ 窗口时间

c++ - 如何在 Windows 上安装 FTGL 库?

c++ - C++ DLL def 文件中的重载函数

c++ - 删除指向结构的指针