Page 1 of 1

Trouble with the C++ <sstream> library

Posted: December 17th, 2008, 10:16 pm
by merev
I have trouble compiling source codes that include the <sstream> library. I am using GNU's g++ compiler and it gives me the message: sstream: No such file or directoryWhat is wrong? How do I fix it? Thanks.M

Trouble with the C++ <sstream> library

Posted: December 18th, 2008, 6:46 am
by ehremo
maybe sstream is microsoft-specific? try using #include <strstream>

Trouble with the C++ <sstream> library

Posted: December 18th, 2008, 6:48 am
by bojan
Are you sure you are calling the g++ compiler? If you have a file named ".c" and just call "gcc", it will call the C compiler not (C++) and I reproduce your message.

Trouble with the C++ <sstream> library

Posted: December 18th, 2008, 2:13 pm
by merev
bojan, my files are .cpp and I am calling g++. ehremo, it must be microsoft-specific. On a windows machine I was able to compile files that use #include <strstream> (but not <sstream>), and on a linux machine #include <sstream> worked (but not <strstream>).thanks guys

Trouble with the C++ <sstream> library

Posted: December 18th, 2008, 2:25 pm
by bojan
Just for future reference, are you using the cygwin distribution g++ ? The include files are part of the compiler package so they should not have anything to do with microsoft.

Trouble with the C++ <sstream> library

Posted: December 18th, 2008, 2:33 pm
by merev
yes, I have the cygwin g++. I just checked the directory of the include files and I have only the strstream, but not the sstream.