title: error : to_string was not declared in this scope
body: <p>I am compiling the code on solaris 5.11.
  G++ version is 4.8.2.</p>
  
  <p>The same code works on Ubuntu but gives the error: 'to_string() was not declared in this scope' on solaris.</p>
  
  <p>I went through many links and tried the following things:</p>
  
  <ol>
  <li>Adding 'std::' before to_string(). This gives error - 'to_string is not a member of std'</li>
  <li>Added 'std=c++11' or 'std=c++0x' while compilation.</li>
  </ol>
  
  <p>Both the above things do not work.</p>
  
  <p>Is there anything related to Solaris?</p>
  
  <p>The actual code was very huge. So simulating the error in sample code below.</p>
  
  <p>temp.cpp</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      string str;
      int i = 10;
      str = "john age is " + to_string(i);
      cout &lt;&lt; str;
      return 0;
  }
  </code></pre>
  
  <p>command: g++ temp.cpp -std=c++0x -o temp</p>