成員我有:cygwin的克++的std :: Stoi旅館「錯誤: 'Stoi旅館' 不是「STD
-cygwin 1.7.25在Windows 7/32位
-g ++ --version - >克++(GCC)4.8.2
-libstdC++一個 - > GCC-克++ - 4.8.2-1
試圖使C++ 的Hello World:
#include <string>
int main()
{
std::string s = "123";
int i = std::stoi(s);
}
編譯給出:
$ 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);
我搜索了幾個小時,但我還是沒能找到解決的辦法。這裏有什麼問題?
奇怪。它應該工作...這似乎是一些奇怪的錯誤。 – Ali