id summary reporter owner description type status milestone component version severity resolution keywords cc 12234 boost::multiprecision x64 win32 hard compile errors on windows with mpir tlyons@… John Maddock "I get a hard compile error in trying to get boost multprecision floating point examples working with mpir on windows x64. The crux of the error is that some of the boost code uses functions whose signatures are long* but the code is used with arguments of type mpir_ui* etc.and of course this is a nasty for pointers! {{{ 1>C:\Program Files\boost\boost_1_61_0\boost/multiprecision/gmp.hpp(982): error C2664: 'double __gmpf_get_d_2exp(mpir_si *,mpf_srcptr)': cannot convert argument 1 from 'long *' to 'mpir_si *' 1> C:\Program Files\boost\boost_1_61_0\boost/multiprecision/gmp.hpp(982): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast }}} One workaround that ""works"" is to define double __gmpf_get_d_2exp(long * p, mpf_srcptr a) : {{{ #include ""stdafx.h"" #include #include #include ""Safeint3.hpp"" #include namespace boost { namespace multiprecision { template struct gmp_float; typedef number > mpf_float_50; typedef number > mpf_float_100; typedef number > mpf_float_500; typedef number > mpf_float_1000; typedef number > mpf_float; } } // namespaces //FIX - define a wrapper double __gmpf_get_d_2exp(long * p, mpf_srcptr a) { mpir_si temp{ *p }; double b = __gmpf_get_d_2exp(&temp, a); *p = SafeInt(temp); return b; } }}} But is this the answer? I find it difficult to get the sense of gmp.hpp well enough to figure out whether or not it knows when it can narrow a variable and when it cannot. Clearly is intended to cope with the 64 32 divide on long; however I am puzzled by code like: {{{ inline void eval_convert_to(long* result, const gmp_rational& val) { double r; eval_convert_to(&r, val); *result = static_cast(r); } inline void eval_convert_to(unsigned long* result, const gmp_rational& val) { double r; eval_convert_to(&r, val); *result = static_cast(r); } }}} Which to my amateur eye does not seem to be nice. Suggestions welcome - mpir is the current version and working nicely; boost is 1.61.0 and working nicely. I would really like to get them working together. Environment - VS 2015-2008, Intel 16.0, windows 7. Terry" Bugs closed Boost 1.62.0 multiprecision Boost 1.61.0 Showstopper fixed mpir x64