Is it possible to use sstream header in mingw 2.95 compiler?.If, it is, then how? I am using C-Free 4.0 and it comes with default mingw2.95 and cygwin compiler
Asked
Active
Viewed 815 times
0
-
1Do you get an error when you try to include it? – juanchopanza Aug 25 '12 at 06:03
-
ya, I get an error, it says its not found in the directory – N. F. Aug 25 '12 at 07:54
-
what compilation command are you using? Maybe your IDE has a way of showing it. – juanchopanza Aug 25 '12 at 07:55
-
1[Version 2.95](http://gcc.gnu.org/gcc-2.95/) isn't exactly the latest release. Using most any other release would be better. – Bo Persson Aug 25 '12 at 11:27
2 Answers
0
sstream is header file that is part of c++ standard library. It is not optional or specific to the gcc compiler. You should be able to include it simply like this:
#include <sstream>
Make sure you are compiling with g++ and not gcc.

anio
- 8,903
- 7
- 35
- 53
-
And you must compile the source as c++ code. If you compile it as C code, including `sstream` wont work. (use a .cpp or similar file extention will probably work) – rve Aug 25 '12 at 06:33
-
I am compiling it through an IDE, I am not aware on the command it uses in this case – N. F. Aug 25 '12 at 07:55
-
@MiNdFrEaK What IDE? Look around in the settings and find the compiler your are invoking. – anio Aug 25 '12 at 19:13
0
g++ 2.95 is really from the stone age. There was no <sstream>
at that time.
(A lot of other things are missing too or don't work like they do in more recent compilers.)
It comes only with the obsolete <strstream>
which is based on char*
.
Your options are:
- Get a newer compiler. Almost anything newer will do.
- If you are really forced to use this one for some reason, you can copy
sstream
from gcc 3.x. That worked for me at that time. But be prepared for more surprises. - Stick with
strstream
but that's ugly...

rtlgrmpf
- 431
- 2
- 6