Serving the Quantitative Finance Community

 
User avatar
merev
Topic Author
Posts: 0
Joined: January 19th, 2006, 9:15 pm

Trouble with the C++ <sstream> library

December 17th, 2008, 10:16 pm

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
 
User avatar
ehremo
Posts: 0
Joined: April 22nd, 2005, 9:49 am

Trouble with the C++ <sstream> library

December 18th, 2008, 6:46 am

maybe sstream is microsoft-specific? try using #include <strstream>
 
User avatar
bojan
Posts: 0
Joined: August 8th, 2008, 5:35 am

Trouble with the C++ <sstream> library

December 18th, 2008, 6:48 am

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.
 
User avatar
merev
Topic Author
Posts: 0
Joined: January 19th, 2006, 9:15 pm

Trouble with the C++ <sstream> library

December 18th, 2008, 2:13 pm

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
 
User avatar
bojan
Posts: 0
Joined: August 8th, 2008, 5:35 am

Trouble with the C++ <sstream> library

December 18th, 2008, 2:25 pm

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.
 
User avatar
merev
Topic Author
Posts: 0
Joined: January 19th, 2006, 9:15 pm

Trouble with the C++ <sstream> library

December 18th, 2008, 2:33 pm

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.