4

这个周末我在试验 C++11,但在尝试使用 std::to_string() 时遇到了问题。gcc 告诉我 std::to_string() 不存在所以我在 basic_string.h 中找到了 to_string 函数,发现它们都被宏包装了

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

我发现在 c++config.h 中定义 _GLIBCXX_USE_C99 的行已经看到它被注释掉了,所以我启用了该宏并再次尝试构建。现在 std::to_string() 变得活跃,但我得到了其他几个错误。

'__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'

解决这个问题的任何线索?我在 cygwin 邮件列表上找到了一篇描述相同问题的帖子,但没有提供好的解决方案。

作为记录,所有其他 C++11 函数都运行良好,只是 std::to_string() 让我很伤心。

4

0 回答 0