我有錯誤「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