GCC issue

Suvayu Ali fatkasuvayu+linux at gmail.com
Tue Oct 8 07:20:58 UTC 2013


Hi,

I have a strange problem.  When I try to use std::to_string() I get the
following error:

  $ g++ -o test_to_string test_to_string.cc
  test_to_string.cc: In function ‘int main()’:
  test_to_string.cc:7:28: error: ‘to_string’ is not a member of ‘std’
     std::cout << "Five: " << std::to_string(5) << std::endl;
                              ^

Here is my test file (test_to_string.cc):

----------8<----------8<----------
#include <iostream>
#include <string>

int main()
{
  std::cout << "Five: " << std::to_string(5) << std::endl;
  return 0;
}
----------8<----------8<----------


A quick search does not point me to any error on my part[1].  Is there a
bug in Fedora GCC?

Thanks for any thoughts.


[1] <http://en.cppreference.com/w/cpp/string/basic_string/to_string>

-- 
Suvayu

Open source is the future. It sets us free.


More information about the users mailing list