Eric Chomko (
[email protected]) wrote:
: Mike Wahler (
[email protected]) wrote:
: : : : > mlimber (
[email protected]) wrote:
: : > : Eric Chomko wrote:
: : > : > I inherited a task which uses a lot of 'ostrstream' in the code. The
: : > port
: : > : > is from an SGI box to Sun which is using GNU C++ (g++ version 3.4.2).
: : > When
: : > : > trying to compile I get several errors all related to 'ostrstream' and
: : > the
: : > : > fact that it is being deprecated from the language, etc.
: : > : >
: : > : > What is the best way to handle fixing this replicating error?
: : >
: : > : "Replicating error"? Not sure what that is.
: : >
: : > Sorry, not good usage. I should have said "reoccurring", as this error is
: : > in many places in the code.
: : >
: : > : The immediate fix could be to turn off that warning (it's not really an
: : > : error, right?) with a command line switch. If that doesn't work, you
: : > : could use a modified (or third-party) strstream library that doesn't
: : > : issue those warnings/errors but has the same syntax (save, perhaps, the
: : > : std namespace), or you could convert it to using std:

stringstream.
: : >
: : > It is an error not a warning.
: : We'll need to see the code causing the errors, and the text
: : of the error messages. I realize your code is probably too
: : large to post here, so try to create a small example program
: : which gives the same error, and post it.
: Will do...
Here is the error text:
/tcore/TigErrList.cpp:136: error: `ostrstream' undeclared (first use this
function)
/tcore/TigErrList.cpp:136: error: (Each undeclared identifier is reported
only once for each function it appears in.)
/tcore/TigErrList.cpp:136: error: expected `;' before "buff"
/tcore/TigErrList.cpp:139: error: `buff' undeclared (first use this
function)
Here is the code segment:
ostrstream buff;
I'm pretty sure that the class 'oststream' is not defined.
: : > Where would I put the "std:

stringstream"?
: : > In the modified strstream include?
: : You'd replace all your ostrstream objects with ostringstream objects.
: : Some of the operations and semantics are different, so it will probably
: : not be a 'drop in' replacement. Compare the documentation of ostrstream
: : and ostringstream to see how to do what you need (btw ostringstream is
: : declared by <sstream> )
Yes, the include module strstream.h is now obsolete and it had the
definition of 'ostrstream' in it.
Eric
: Thanks,
: Eric
: : -Mike