I've seen this problem thrown around on multiple forums, but never with a clear/relevant answer. I'm attempting to use some c++11 functions (namely, stoi(string s)), but am always greeted by the compiler error "'stoi' is not a member of 'std'" or "'stoi' was not declared in this scope". I've already done the obvious and included <string> in my .cpp and put -std=c++11 in the compiler parameters. Can anyone shed light on what I'm doing wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From memory, I can tell you that stoi and friends are Microsoft specific extensions of C++11. This means that when you're not using Visual C++ to compile your stuff, you will have to roll your own.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've seen this problem thrown around on multiple forums, but never with a clear/relevant answer. I'm attempting to use some c++11 functions (namely, stoi(string s)), but am always greeted by the compiler error "'stoi' is not a member of 'std'" or "'stoi' was not declared in this scope". I've already done the obvious and included <string> in my .cpp and put -std=c++11 in the compiler parameters. Can anyone shed light on what I'm doing wrong?
Does std::stoi(string s) fail as well?
Last edit: FurryGuy 2014-07-06
From memory, I can tell you that stoi and friends are Microsoft specific extensions of C++11. This means that when you're not using Visual C++ to compile your stuff, you will have to roll your own.