编译错误:to_string不是std的成员

时间:2014-08-15 13:34:47

标签: c++ c++11 compiler-errors std g++4.8

我的代码是这样的:

#include <string>
int main()
{
    for (int i = 0; i < 3; i++)
    {
        std::string flag = "I got a number like : " + std::to_string(i);
    }
}

当我尝试使用g ++ 4.8.2在我的FreeBSD 9.2机器上编译它时,我收到以下错误:

error: 'to_string' is not a member of 'std'
std::string flag = "I got a number like : " + std::to_string(i);

是的我正在使用-std=c++11而不是我没有使用minGW

编译行:g++48 -g -std=c++11 -Wall -O2 -m32 -pipe -fexceptions -D_THREAD_SAFE -DNDEBUG -mtune=i686 -fstack-protector-all

0 个答案:

没有答案
相关问题