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.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…