4

I was experimenting with C++11 this weekend but I ran into problem when trying to use std::to_string(). gcc was telling me that std::to_string() did not exist so I found the to_string functions in basic_string.h and found that they were all wrapped with the macro

#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
 && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))

I find the line in c++config.h that defines _GLIBCXX_USE_C99 has saw it was commented out, so I enable that macro and try building again. Now the std::to_string() becomes active but I get several other errors.

'__gnu_css::wcstold' has not been declared
'::wcstold' has not been declared
'std::wcstold' has not been declared
'strtold' is not a member of 'std'
'wcstold' is not a member of 'std'

Any clues to fixing this? I found a post on the cygwin mailing list describing the same problem but there wasn't a good solution offered.

For the record all the other C++11 functions are working great, just std::to_string() that's giving me grief.

Dan
  • 1,805
  • 2
  • 18
  • 21
  • I know, your question is very old, but today another user stumbled over the same issue. We found out that it was asked on StackOverflow before: http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-so-g – leemes Nov 03 '15 at 15:05

0 Answers0