it says sstream isn't a recognizable library |
When you need to ask about errors, always post them verbatim. This helps others find your post, eliminates the risk of the poster misinterpreting it, and might jog the memory of people who have encountered the error before you.
<sstream>
has been available since C++98. It is unlikely that your compiler does not support any version of standard C++. First, edit your post to include the errors you got, and then please issue
g++ --version | head -1
at your Cygwin shell, put the results here. This will tell you the version of g++ you are using.
std::to_string()
is available as part of C++11 and later, as part of
<string>
, not
<sstream>
.
For compiler versions in the 4.3.x series or later, you should be able to get at least some C++11 support by compiling with the appropriate flag. As for 6.x.x (as of now, the latest version is 6.2.1), C++11 support (with some extensions) is enabled by default.
For compiler versions in [4.3.0, 4.7.0), you should be able to pass the flag
-std=c++0x
to the compiler for preliminary support of C++11.
For compiler versions starting at 4.7.0, you should be able to enable (at least partial) support for C++11 by passing the flag
-std=c++11
to the compiler.
It's usually worth updating your compiler because most of the changes are bug-fixes. Your compilers are tested
heavily by the developers - and while you are relatively unlikely to encounter a compiler bug in stable releases as an end user, it will suck badly if you do. (I don't know how to update Cygwin installations. The newest version of G++ is available from
https://gcc.gnu.org/svn.html .)