简体   繁体   中英

How can I enable _GLIBCXX_USE_C99 on Solaris 8 SPARC?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM