cygwin g++ std::stoi "error: ‘stoi’ is not a member of ‘std

Solution 1:

That's a bug, possibly an incomplete port of some library code to cygwin (it's a cplusplus11 feature) - some stuff has to be changed after all. Make sure to report it.

The solution is easy of course: #include <cstdlib> strtol(s.c_str(),0,10);

www.cplusplus.com/.../strtol

A similar mingw bug is mentioned also here

std::stoi doesn't exist in g++ 4.6.1 on MinGW

Solution 2:

I have the same problem yesterday. "error: 'stoi' is not a member of 'std'."

First, I made sure c++11 was enabled. Then, I updated the g++ compiler to the newest version. After that, this error disappeared.

Solution 3:

The compiler is not being taken seriously. On windows your best bet is to probably use visual studio, as it is always kept up to date . The bug here is that the macro defs are wrong to begin with. The problem starts from iomanip.h and iosbase . So they would have to changed all of there code. There are user made patches for this but I would not trust them at all, as they may contain even more bugs then the original copies. But it's up to you , I just stick with visual studio express edition.