gpt4 book ai didi

c++ - 如何在 Solaris 8 SPARC 上启用 _GLIBCXX_USE_C99?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:45:26 26 4
gpt4 key购买 nike

我已经为 Solaris 8 sparc 构建了 gcc 4.6.1。我正在编译一些使用 boost::lexical_cast (boost 1.48) 的代码,但出现此错误:

boost/math/special_functions/sign.hpp: In function 'int boost::math::detail::signbit_impl(T, const boost::math::detail::native_tag&)'
error: 'signbit' is not a member of 'std'

(对于 fpclassify、isfinite、isnormal、isinf、isnan 也有类似的错误)

我查看了 cmath header ,它根据是否定义了 _GLIBCXX_USE_C99_MATH 有条件地定义了 std::signbit。我运行了 cpp -dM,发现 _GLIBCXX_USE_C99_MATH 未定义。有没有办法启用 C99 支持?我必须重建 libc 还是这个平台太旧了?我不在我的元素范围内,所以任何有关如何使这项工作正常进行的指导都会很棒。

最佳答案

您的平台 C 库可能太旧,无法支持 C99 FP 库添加。

来自Sun Studio 12 User's Guide :

Note - Though the compiler defaults to supporting the features of C99 listed below, standard headers provided by the Solaris software in /usr/include do not yet conform with the 1999 ISO/IEC C standard. If error messages are encountered, try using -xc99=none to obtain the 1990 ISO/IEC C standard behavior for these headers.

关于c++ - 如何在 Solaris 8 SPARC 上启用 _GLIBCXX_USE_C99?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10391506/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com