I have been able to find quite a few questions on this, but all seem to point that it should be working with gcc 4.8.1 if you compile with -std=c++11
Here is my output of g++ --version:
g++ (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Yet when I try to compile something with std::tostring even with a simple command like this:
g++ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -o "Main.o" "Main.cpp"
I get the following error:
Main.cpp: In function 'int main()':
Main.cpp:6:26: error: 'to_string' is not a member of 'std'
std::string intString = std::to_string(1335);
Even on a file as simple as:
#include <string>
#include <cstdio>
int main()
{
std::string intString = std::to_string(1335);
printf(intString.c_str());
return 0;
}
Any ideas? This is on Windows 7 64-bit using the latest version of MinGW.