Linux.com

Previous Topic | Next Topic
Print this topic | You are not subscribed
Author Message
Joined: Jun 26, 2007
Posts: 3
Other Topics
Posted Jun 26, 2007 at 8:01:49 PM
Subject: sstream and strstream usage
I've been reading numerous forums regarding strstream and I understand that it has been deprecated. But I found another forum where someone mentioned that sstream, which replaced strstream was also deprecated. Can anyone confirm if this is true? If sstream was deprecated what was it replaced with? Regardless, I have sstream in my include directory so I'm going to try using it. (I'm using gcc version 3.2.3, Linux Redhat) But now that I've #include <sstream> I get all kinds of the following erors: /usr/include/g++-3/sstream:49: syntax error before `&' token /usr/include/g++-3/sstream:62: syntax error before `}' token /usr/include/g++-3/sstream:64: syntax error before `(' token Can anyone lend any insight as to what these errors mean? TIA, Jennifer
Back to top Profile Email
James Buchwald
Joined Jun 26, 2007
Posts: 7

Other Topics
Posted: Jun 26, 2007 9:03:06 PM
Subject: sstream and strstream usage
Could you post those lines of code, and maybe the surrounding lines? Those are such general errors that they could mean anything...
Back to top Profile Email Website
Jennifer
Joined Jun 26, 2007
Posts: 3

Other Topics
Posted: Jun 26, 2007 9:45:06 PM
Subject: sstream and strstream usage
Well, all i've done was #include <sstream> in my code. I haven't actually used it yet! As soon as I remove the include, the errors go away.
Back to top Profile Email
James Buchwald
Joined Jun 26, 2007
Posts: 7

Other Topics
Posted: Jun 27, 2007 12:44:06 AM
Subject: sstream and strstream usage
All you did is switch to #include <sstream>? Did you remember to switch the stream data types? Like, for example, where there would be "strstream" or similar, it would now be "stringstream", or something similar. "ostrstream" would become "ostringstream", etc.
Back to top Profile Email Website
Jennifer
Joined Jun 26, 2007
Posts: 3

Other Topics
Posted: Jun 27, 2007 1:03:17 AM
Subject: sstream and strstream usage
Yes, I changed strstream to use stringstream, but I actually commented out all that code because of all the errors. So my file does not actually make any calls to sstream or strstream, it just includes sstream and I still get the errors. As soon as I comment out the include, the errors go away. I know it sees the file since the error messages include the path to sstream. Is there some compiler option I'm missing?
Back to top Profile Email
James Buchwald
Joined Jun 26, 2007
Posts: 7

Other Topics
Posted: Jun 27, 2007 1:20:44 AM
Subject: sstream and strstream usage
That's... strange. I've never heard of anything like that before... Just guessing, but are you including both <strstream> and <sstream>? That could mess things up...
Back to top Profile Email Website
Felipe Sateler

Joined Jan 01, 1970
Posts: 2

Other Topics
Posted: Jun 28, 2007 10:20:00 PM
Subject: sstream and strstream usage
What is the compile command you are using?
Back to top Profile Email
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya