5

I've built gcc 4.6.1 for Solaris 8 sparc. I'm compiling some code that uses boost::lexical_cast (boost 1.48) and I get this error:

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'

(Also similar errors for fpclassify, isfinite, isnormal, isinf, isnan)

I looked at the cmath header and it defines std::signbit conditionally depending on whether _GLIBCXX_USE_C99_MATH is defined. I ran cpp -dM and I see that _GLIBCXX_USE_C99_MATH is not defined. Is there a way to enable the C99 support? Do I have to rebuild libc or is this platform just too old? I'm out of my element so any guidance on getting this working would be great.

4

1 に答える 1

2

Your platform C library is likely too old to support the C99 FP library additions.

From the 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.

于 2015-02-10T16:00:19.433 に答える