Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2006-11-08 01:56:53


With the latest boost CVS, both VC 7.1 and VC 8.0 fail to compile #include <boost/rational.hpp> The error is shown below. The problem is due to "unsigned long long" being the same as "unsigned __int64", which makes this code in boost/math/common_factor_rt.hpp fail: #ifdef BOOST_HAS_LONG_LONG BOOST_PRIVATE_GCD_UF( unsigned long long ); #endif #ifdef BOOST_HAS_MS_INT64 BOOST_PRIVATE_GCD_UF( unsigned __int64 ); #endif As a quick workaround I tried: #ifdef BOOST_HAS_LONG_LONG # if !defined(_MSC_VER) BOOST_PRIVATE_GCD_UF( unsigned long long ); # endif #endif And a similar patch a few lines down (complete diff is below). This fixes the problem. I am sure this is not the final answer, but I'm uncertain which combinations of #if defined(...) is acceptable. Advice is highly appreciated. Thanks! Cheers, Ralf This is with VC 8.0: C:\home\rwgk\dist\build80>cl /DBOOST_DISABLE_THREADS /DNDEBUG /Ox /GR /EHsc /nologo /D_SECURE_SCL=0 /D_CRT_SECURE_NO_DEPRECATE /wd4996 /Zm800 /IC:\home\rwgk\dis t\boost /c include_rational.cpp include_rational.cpp C:\home\rwgk\dist\boost\boost/math/common_factor_rt.hpp(302) : error C2766: explicit specialization; 'boost::math::detail::gcd_optimal_evaluator<unsigned __int64>' has already been defined C:\home\rwgk\dist\boost\boost/math/common_factor_rt.hpp(298) : see previous definition of 'gcd_optimal_evaluator<unsigned __int64>' C:\home\rwgk\dist\boost\boost/math/common_factor_rt.hpp(326) : error C2766: explicit specialization; 'boost::math::detail::gcd_optimal_evaluator<__int64>' has already been defined C:\home\rwgk\dist\boost\boost/math/common_factor_rt.hpp(322) : see previous definition of 'gcd_optimal_evaluator<__int64>' Index: common_factor_rt.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/math/common_factor_rt.hpp,v retrieving revision 1.2 diff -u -r1.2 common_factor_rt.hpp --- common_factor_rt.hpp 5 Nov 2006 07:10:42 -0000 1.2 +++ common_factor_rt.hpp 8 Nov 2006 06:36:01 -0000 @@ -295,7 +295,9 @@ BOOST_PRIVATE_GCD_UF( unsigned long ); #ifdef BOOST_HAS_LONG_LONG +# if !defined(_MSC_VER) BOOST_PRIVATE_GCD_UF( unsigned long long ); +# endif #endif #ifdef BOOST_HAS_MS_INT64 @@ -319,7 +321,9 @@ BOOST_PRIVATE_GCD_SF( char, unsigned char ); // should work even if unsigned #ifdef BOOST_HAS_LONG_LONG +# if !defined(_MSC_VER) BOOST_PRIVATE_GCD_SF( long long, unsigned long long ); +# endif #endif #ifdef BOOST_HAS_MS_INT64


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk