Linker error on windows
Hi, 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? 1>------ Build started: Project: boostfindzero, Configuration: Debug Win32 ------ 1>Compiling... 1>findroot_demo.cpp 1>Linking... 1>findroot_demo.obj : error LNK2019: unresolved external symbol _rint referenced in function "public: static double __cdecl boost::numeric::interval_lib::detail::x86_rounding::to_int(double const &)" (?to_int@x86_rounding@detail@interval_lib@numeric@boost@@SANABN@Z) 1>D:\dokumenter\lvm_AM\Visual Studio 2008\Projects\boostfindzero\Debug\boostfindzero.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\dokumenter\lvm_AM\Visual Studio 2008\Projects\boostfindzero\boostfindzero\Debug\BuildLog.htm" 1>boostfindzero - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Thanks in advance. /Lars
If you are using Visual Studio you need to have the Boost library path you are using referenced correctly in Project>Properties>Configuration Properties>C/C++>General>Additional Include Directories and Project>Properties>Configuration Properties>Linker>General>Additional Library Directories have you done this yet? Quoting Lars Mogensen <larsvmogensen@gmail.com>:
Hi,
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?
1>------ Build started: Project: boostfindzero, Configuration: Debug Win32 ------ 1>Compiling... 1>findroot_demo.cpp 1>Linking... 1>findroot_demo.obj : error LNK2019: unresolved external symbol _rint referenced in function "public: static double __cdecl boost::numeric::interval_lib::detail::x86_rounding::to_int(double const &)" (?to_int@x86_rounding@detail@interval_lib@numeric@boost@@SANABN@Z) 1>D:\dokumenter\lvm_AM\Visual Studio 2008\Projects\boostfindzero\Debug\boostfindzero.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\dokumenter\lvm_AM\Visual Studio 2008\Projects\boostfindzero\boostfindzero\Debug\BuildLog.htm" 1>boostfindzero - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks in advance.
/Lars
-- Jared James Thompson Department of Medicinal Chemistry and Molecular Pharmacology Laboratory for Computational Drug Design and Biology RHPH 504C Heine Pharmacy Building 575 Stadium Mall Drive West Lafayette, IN 47907-2091
In Additional Include Directories I have: D:\src\boost_1_36_0 In Additional Library Directories I have: D:\src\boost_1_36_0\stage\lib "stage" is the directory where I compiled the BOOST libraries. I link against: libboost_unit_test_framework-vc90-mt.lib libboost_math_c99-vc90-mt.lib Please advice. 2010/9/16 Jared James Thompson <thompsjj@purdue.edu>
If you are using Visual Studio you need to have the Boost library path you are using referenced correctly in
Project>Properties>Configuration Properties>C/C++>General>Additional Include Directories
and
Project>Properties>Configuration Properties>Linker>General>Additional Library Directories
have you done this yet?
Quoting Lars Mogensen <larsvmogensen@gmail.com>:
Hi,
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?
1>------ Build started: Project: boostfindzero, Configuration: Debug Win32 ------ 1>Compiling... 1>findroot_demo.cpp 1>Linking... 1>findroot_demo.obj : error LNK2019: unresolved external symbol _rint referenced in function "public: static double __cdecl boost::numeric::interval_lib::detail::x86_rounding::to_int(double const &)" (?to_int@x86_rounding@detail@interval_lib@numeric@boost@@SANABN@Z) 1>D:\dokumenter\lvm_AM\Visual Studio 2008\Projects\boostfindzero\Debug\boostfindzero.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://d:\dokumenter\lvm_AM\Visual Studio 2008\Projects\boostfindzero\boostfindzero\Debug\BuildLog.htm" 1>boostfindzero - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks in advance.
/Lars
-- Jared James Thompson Department of Medicinal Chemistry and Molecular Pharmacology Laboratory for Computational Drug Design and Biology RHPH 504C Heine Pharmacy Building 575 Stadium Mall Drive West Lafayette, IN 47907-2091 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
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. HTH, John.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of John Maddock Sent: Thursday, September 16, 2010 5:05 PM To: boost-users@lists.boost.org 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@hetp.u-net.com 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> ]
I can see that you have found out the same as I have. The rint() function is not supported by the MSVC standard math library. I have found several rint() implementations using google, but will it help to put this into the version that I am limited to (1.36)? I can see that rint() is also in the new 1.44 version "msvc_rounding_control.hpp". Is it something I am doing wrong? /Lars 2010/9/16 Paul A. Bristow <pbristow@hetp.u-net.com>
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of John Maddock Sent: Thursday, September 16, 2010 5:05 PM To: boost-users@lists.boost.org 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@hetp.u-net.com
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Does anyone know if this issue is being handled in future versions of BOOST? The rounding functions of BOOST math are not compatible with the MS Visual C++ development suite. They use the rint() call from the math library, which is not supported. Where should I post this to alert the developers? /Lars 2010/9/17 Lars Mogensen <larsvmogensen@gmail.com>
I can see that you have found out the same as I have. The rint() function is not supported by the MSVC standard math library.
I have found several rint() implementations using google, but will it help to put this into the version that I am limited to (1.36)? I can see that rint() is also in the new 1.44 version "msvc_rounding_control.hpp". Is it something I am doing wrong?
/Lars
2010/9/16 Paul A. Bristow <pbristow@hetp.u-net.com>
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of John Maddock Sent: Thursday, September 16, 2010 5:05 PM To: boost-users@lists.boost.org 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@hetp.u-net.com
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Lars Mogensen Sent: Friday, September 24, 2010 8:25 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Linker error on windows Does anyone know if this issue is being handled in future versions of BOOST? The rounding functions of BOOST math are not compatible with the MS Visual C++ development suite. They use the rint() call from the math library, which is not supported. Where should I post this to alert the developers? Since nobody has spoken up, I think you should post a Trac 'bug/feature' report for Boost.Interval . Hopefully this bring it to their attention. (You've heard from Boost.Math developers and they are claiming 'it's not their table' ;-) - at least for now! Paul /Lars 2010/9/17 Lars Mogensen <larsvmogensen@gmail.com> I can see that you have found out the same as I have. The rint() function is not supported by the MSVC standard math library. I have found several rint() implementations using google, but will it help to put this into the version that I am limited to (1.36)? I can see that rint() is also in the new 1.44 version "msvc_rounding_control.hpp". Is it something I am doing wrong? I don't think so. <snip> to end.
I have made a bug report on this issue some time ago. It should now be corrected in SVN, but I have not checked it out yet and tested it.
From what I understand it will be included in BOOST 1.46.
Thanks a lot for your help. Best regards Lars 2010/9/26 Paul A. Bristow <pbristow@hetp.u-net.com>
*From:* boost-users-bounces@lists.boost.org [mailto: boost-users-bounces@lists.boost.org] *On Behalf Of *Lars Mogensen *Sent:* Friday, September 24, 2010 8:25 AM
*To:* boost-users@lists.boost.org *Subject:* Re: [Boost-users] Linker error on windows
Does anyone know if this issue is being handled in future versions of BOOST?
The rounding functions of BOOST math are not compatible with the MS Visual C++ development suite. They use the rint() call from the math library, which is not supported.
Where should I post this to alert the developers?
Since nobody has spoken up, I think you should post a Trac 'bug/feature' report for Boost.Interval .
Hopefully this bring it to their attention.
(You've heard from Boost.Math developers and they are claiming 'it's not their table' ;-) - at least for now!
Paul
/Lars
2010/9/17 Lars Mogensen <larsvmogensen@gmail.com>
I can see that you have found out the same as I have. The rint() function is not supported by the MSVC standard math library.
I have found several rint() implementations using google, but will it help to put this into the version that I am limited to (1.36)? I can see that rint() is also in the new 1.44 version "msvc_rounding_control.hpp". Is it something I am doing wrong?
I don't think so.
<snip> to end.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (4)
-
Jared James Thompson
-
John Maddock
-
Lars Mogensen
-
Paul A. Bristow