我有:
Windows 7/32bit上的-cygwin 1.7.25
-g ++ --version - > g ++(GCC)4.8.2
-libstdc ++.a - > gcc-g ++ - 4.8.2-1
试图制作一个c ++ Hello World:
#include <string>
int main()
{
std::string s = "123";
int i = std::stoi(s);
}
Run Code Online (Sandbox Code Playgroud)
编译给出:
$ g++ -std=c++11 main.cpp
main.cpp: In function ‘int main()’:
main.cpp:6:10: error: ‘stoi’ is not a member of ‘std’
int i = std::stoi(s);
Run Code Online (Sandbox Code Playgroud)
我搜索了几个小时,但我仍然找不到解决方案.这是什么问题?