I am trying to build libtorrent on RHEL 9 which supports Python 3.9. I am using the following libraries for to make libtorrent.
boost-pic-1.65.1.tgz
libtorrent-rasterbar-1.1.5.tar.gz
During make process, it fails with compilation errors when trying to make boost library.
make[3]: Entering directory '/grid/0/jenkins/cmf/build/redhat9/libtorrent/build/src'
CXX session_impl.lo
In file included from /grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind.hpp:22,
from session_impl.cpp:51:
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp: In instantiation of 'struct boost::_bi::add_cref<bool (boost::shared_ptr<libtorrent::peer_connection>::*)() const noexcept, 1>':
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp:2286:46: required from 'struct boost::_bi::dm_result<bool (boost::shared_ptr<libtorrent::peer_connection>::*)() const noexcept, boost::arg<1> >'
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp:2305:1: required by substitution of 'template<class A1, class M, class T> boost::_bi::bind_t<typename boost::_bi::dm_result<M T::*, A1>::type, boost::_mfi::dm<M, T>, typename boost::_bi::list_av_1<A1>::type> boost::bind(M T::*, A1) [with A1 = boost::arg<1>; M = bool() const noexcept; T = boost::shared_ptr<libtorrent::peer_connection>]'
session_impl.cpp:3036:18: required from here
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp:2249:23: error: forming reference to qualified function type 'bool() const noexcept'
2249 | typedef M const & type;
| ^~~~
In file included from /grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind.hpp:22,
from session_impl.cpp:51:
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp: In instantiation of 'struct boost::_bi::result_traits<boost::_bi::unspecified, bool (boost::shared_ptr<libtorrent::peer_connection>::*)() const noexcept>':
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp:1284:48: required from 'class boost::_bi::bind_t<boost::_bi::unspecified, bool (boost::shared_ptr<libtorrent::peer_connection>::*)() const noexcept, boost::_bi::list1<boost::arg<1> > >'
session_impl.cpp:3036:18: required from here
/grid/0/jenkins/cmf/build/redhat9/boost//include/boost/bind/bind.hpp:75:37: error: 'bool (boost::shared_ptr<libtorrent::peer_connection>::*)() const noexcept' is not a class, struct, or union type
75 | typedef typename F::result_type type;
| ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:71,
from /usr/include/c++/11/algorithm:61,
from session_impl.cpp:38:
Please suggests
- why the error is happening? I am not completely sure what the error suggests exactly. I have not worked with cpp extensively.
- What solutions can I try to overcome this?
Any pointers would be appreciated. I am newbie to libtorrent and cpp stuff. Thanks.
I was able to build libtorrent on CentOS just now from a fresh install with
Now building using
ran into a compiler error:
The key is:
I patched that to be more const-correct:
And now it builds completely: