我试图在Linux(Redhat)中运行旧的C++代码.我使用的是gcc 4.1.2版.
我收到以下错误:
error: strstream.h: No such file or directory
/trnuser1/rmtrain/DevelopmentEnv/Generic/CoreObjects/GCVTransformationServices.cpp:41: error: âostrstreamâ was not declared in this scope
/trnuser1/rmtrain/DevelopmentEnv/Generic/CoreObjects/GCVTransformationServices.cpp:41: error: expected `;' before âstrDestXMLâ
/trnuser1/rmtrain/DevelopmentEnv/Generic/CoreObjects/GCVTransformationServices.cpp:62: error: âstrDestXMLâ was not declared in this scope
Run Code Online (Sandbox Code Playgroud)
这个代码在Solaris下运行正常,gcc版本为2.95.错误指向的行包含以下语句:
ostrstream strDestXML;
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
你可以#include <strstream>(注意没有'.h'后缀).但是,如果你要正确地将代码移植到现代C++,你应该考虑改变以#include <sstream>和std::ostringstream strDestXML;为在注释建议.
| 归档时间: |
|
| 查看次数: |
11827 次 |
| 最近记录: |