سؤال

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