我有错误“Function”to_string'clould not be resolved“,尽管其他C++ 11表达式正常运行。我在Linux Mint上使用Eclipse Mars CDT和GCC-C++ 4.9。std :: to_string()无法解析
#include <iostream>
#include <string>
using std::string;
int main()
{
int a = 123;
string str = std::to_string(a);
}
是的,我使用-std = C++ 11,__GXX_EXPERIMANTAL_CXX0X__和-std =的C++ 0x。
你有没有'#包括'和'用-std = C++编译11'? –
NathanOliver
对不起,我粘贴了错误的代码。 –
欢迎来到Stack Overflow! '使用std :: string'后冒号是什么?请** [编辑] **您的问题与[mcve]或[SSCCE(Short,Self Contained,Correct Example)](http://sscce.org) – NathanOliver