I tried compiling this simple program on IdeOne (which uses gcc 4.5.1) and on my Linux computer (which uses something like 4.6.4):
#include <string>
#include <iostream>
int main() {
std::cout << std::stoi("32") << std::endl;
}
And it compiles perfectly and outputs 32
. However, when I try to compile it on my windows computer with MinGW and gcc 4.6.1, I get this error:
test.cpp: In function 'int main()':
test.cpp:5:19: error: 'stoi' is not a member of 'std'
The same happens with std::stoul
, etc. Does std::stoi
and family not exist in MinGW for some reason? I thought gcc on MinGW (sh|w)ould behave the same as on Linux.
g++ -std=c++0x test.cpp
– Seth Carnegieg++ -v
on MinGW and you get a certain version, it doesn't mean anything as to what features it implements? – Seth Carnegie