C++ 无法解析std::to_string()
虽然其他C++11表达式正在正常运行,但我有一个错误“Function”to_string“clould not resolved”。我在LinuxMint上使用EclipseMarsCDT和GCC-C++4.9C++ 无法解析std::to_string(),c++,c++11,C++,C++11,虽然其他C++11表达式正在正常运行,但我有一个错误“Function”to_string“clould not resolved”。我在LinuxMint上使用EclipseMarsCDT和GCC-C++4.9 #include <iostream> #include <string> using std::string; int main() { int a = 123; string str = std::to_string(a); } #包括
#include <iostream>
#include <string>
using std::string;
int main()
{
int a = 123;
string str = std::to_string(a);
}
#包括
#包括
使用std::string;
int main()
{
INTA=123;
字符串str=std::to_字符串(a);
}
是的,我使用了-std=c++11、-uuuuugxx\u EXPERIMANTAL\u CXX0X\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu!使用std::string后的冒号是什么?请用一个或@NathanOliver来回答你的问题好吧,我纠正了这个小错误。
-std=c++11
足够好了-不要用“\uuuugxx\u EXPERIMANTAL\u CXX0X\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu。他们不能使用c++11,这也会导致此问题。@NathanOliver它至少标记了c++11,并在问题中指定了其他c++11表达式正在工作是的,它标记为c++11,但如果它们没有使用-std=c++11
编译,那么这就是答案,您的答案将是错误的。@NathanOliver注意到他指定的其他c++11表达式正在运行OP添加了代码,看起来这两个问题都解决了。