Been having the problem for a while. Searched thoroughly on stackoverflow and other sites to figure out the problem.
I have c++2011, using the latest version of cygwin for terminal, and GCC 4.8.3. I tried adding -std=c++0x and -std=gnu++0x to the command line, but neither of them fixed the problem. Here's the code I've been using the test if it will work. to anyone who can help!
#include <iostream>
#include <string>
using namespace std;
int main(){
int a = 1;
string b = to_string(a);
cout<< b;
return 0;
}
Here's what I used to compile as well as the error:
$ g++ -std=gnu++0x stringTest.cpp -o stringTest stringTest.cpp: In function ‘int main()’: stringTest.cpp:8:24: error: ‘to_string’ was not declared in this scope string b = to_string(a);
^
Anyone have any idea what's going on? I have an assignment due soon that I have to use this for and really need to get it working. Thanks in advance