문제

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

도움이 되었습니까?

해결책

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...

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top