Boost logo

Boost Users :

Subject: Re: [Boost-users] Linker error on windows
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2010-09-16 12:19:12


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of John Maddock
> Sent: Thursday, September 16, 2010 5:05 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] Linker error on windows
>
> >> > I am using BOOST to do math and have not been able to get the
> >> > "findroot_demo.cpp" example of root finding to work. There seem to
> >> > be a reference to rint(), which is not implemented in the C++
> >> > library for windows. How can I solve this - my understanding of
> >> > BOOST is that it is cross-platform?
>
> Unfortunately this is either a Boost or an MSVC bug depending upon your
point
> of view :-(
>
> Boost.Interval depends upon a number of std lib rounding functions to do
it's
> work. One of them is "rint" which MSVC used to supply, but for some
reason
> recent releases have simply dropped it, with no suitable replacement.
> If you google for msvc and rint you should find some replacements for that
> function.

I tried this quickly using naïve (but plausible) rint code

double rint(double x)
{
     return floor(x + 0.5);
}

from

http://suncallmoonbright.blogspot.com/2008/12/mingw-to-msvc-case-of-rint.htm
l

but then I got the error below -and decided someone who knew more about it
should look at it ;-)

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]
I:\boost-trunk\boost/numeric/interval/rounded_arith.hpp(108): error C3861:
'to_int': identifier not found
          I:\boost-trunk\boost/numeric/interval/rounded_arith.hpp(108) :
while compiling class template member function 'double
boost::numeric::interval_lib::rounded_arith_opp<T>::int_down(const T &)'
          with
          [
              T=double
          ]
          I:\boost-trunk\boost/numeric/interval/rounding.hpp(77) : see
reference to class template instantiation
'boost::numeric::interval_lib::rounded_arith_opp<T>' being compiled
          with
          [
              T=double
          ]
          I:\boost-trunk\boost/numeric/interval/hw_rounding.hpp(59) : see
reference to class template instantiation
'boost::numeric::interval_lib::save_state<Rounding>' being compiled
          with
          [
 
Rounding=boost::numeric::interval_lib::rounded_arith_opp<double>
          ]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net