Libtorrent: RC_1_2 branch fails to build with Boost 1.72.0

Created on 12 Nov 2019  Â·  5Comments  Â·  Source: arvidn/libtorrent

Regressed by https://github.com/boostorg/asio/commit/935dad16cb75

$ c++ --version
FreeBSD clang version 9.0.0 (tags/RELEASE_900/final 372316) (based on LLVM 9.0.0)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
FAILED: CMakeFiles/torrent-rasterbar.dir/src/http_connection.cpp.o
/usr/bin/c++  -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_EXCEPTION_DISABLE -DTORRENT_BUILDING_LIBRARY -DTORRENT_BUILDING_SHARED -DTORRENT_USE_ICONV -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -D_FILE_OFFSET_BITS=64 -Dtorrent_rasterbar_EXPORTS -I/path/to/libtorrent/include -I/path/to/libtorrent/ed25519/src -I/usr/local/include -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -Weverything -Wno-documentation -Wno-c++98-compat-pedantic -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables -fexceptions -MD -MT CMakeFiles/torrent-rasterbar.dir/src/http_connection.cpp.o -MF CMakeFiles/torrent-rasterbar.dir/src/http_connection.cpp.o.d -o CMakeFiles/torrent-rasterbar.dir/src/http_connection.cpp.o -c /path/to/libtorrent/src/http_connection.cpp
In file included from /path/to/libtorrent/src/http_connection.cpp:33:
In file included from /path/to/libtorrent/include/libtorrent/http_connection.hpp:51:
In file included from /path/to/libtorrent/include/libtorrent/socket.hpp:55:
In file included from /usr/local/include/boost/asio/write.hpp:1262:
/usr/local/include/boost/asio/impl/write.hpp:425:40: error: no type named 'executor_type' in 'libtorrent::aux::socket_type'
    typedef typename AsyncWriteStream::executor_type executor_type;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/local/include/boost/asio/impl/write.hpp:534:7: note: in instantiation of template class 'boost::asio::detail::initiate_async_write_buffer_sequence<libtorrent::aux::socket_type>' requested here
      detail::initiate_async_write_buffer_sequence<AsyncWriteStream>(s),
      ^
/path/to/libtorrent/src/http_connection.cpp:270:3: note: in instantiation of function template specialization 'boost::asio::async_write<libtorrent::aux::socket_type, boost::asio::mutable_buffers_1, std::__1::__bind<void (libtorrent::http_connection::*)(const boost::system::error_code &), std::__1::shared_ptr<libtorrent::http_connection> &, const std::__1::placeholders::__ph<1> &> >' requested here
                async_write(m_sock, boost::asio::buffer(m_sendbuffer)
                ^
1 error generated.

Most helpful comment

does this patch fix it for you? https://github.com/arvidn/libtorrent/pull/4091

All 5 comments

does this patch fix it for you? https://github.com/arvidn/libtorrent/pull/4091

Yes, it builds fine with the patch.

sorry @arvidn , hope this is not the wrong place to ask, but is there a similar fix for the RC_1_1 branch?

  CXX      http_connection.lo
In file included from /usr/include/boost/asio/write.hpp:1246,
                 from ../include/libtorrent/socket.hpp:57,    
                 from ../include/libtorrent/http_connection.hpp:62,
                 from http_connection.cpp:33:             
/usr/include/boost/asio/impl/write.hpp: In instantiation of ‘class boost::asio::detail::initiate_async_write_buffer_sequence<libtorrent::socket_type>’:                                  
/usr/include/boost/asio/impl/write.hpp:534:15:   required from ‘typename boost::asio::async_result<typename std::decay<WriteHandler>::type, void(boost::system::error_code, long unsigned int)>::return_type boost::asio::async_write(AsyncWriteStream&, const ConstBufferSequence&, WriteHandler&&, typename std::enable_if<boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value>::type*) [with AsyncWriteStream = libtorrent::socket_type; ConstBufferSequence = boost::asio::mutable_buffers_1; WriteHandler = boost::_bi::bind_t<void, boost::_mfi::mf1<void, libtorrent::http_connection, const boost::system::error_code&>, boost::_bi::list2<boost::_bi::value<boost::shared_ptr<libtorrent::http_connection> >, boost::arg<1> > >; typename boost::asio::async_result<typename std::decay<WriteHandler>::type, void(boost::system::error_code, long unsigned int)>::return_type = void; typename std::enable_if<boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value>::type = void]’
http_connection.cpp:278:53:   required from here                            
/usr/include/boost/asio/impl/write.hpp:425:54: error: no type named ‘executor_type’ in ‘struct libtorrent::socket_type’
  425 |     typedef typename AsyncWriteStream::executor_type executor_type;
      |                                                      ^~~~~~~~~~~~~
make[1]: *** [Makefile:940: http_connection.lo] Error 1

@Ponce could you test this patch? https://github.com/arvidn/libtorrent/pull/4177

it built smoothly with it (slackware64-current, gcc 9.2.0, boost-1.72.0), thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fastesol picture fastesol  Â·  17Comments

ghost picture ghost  Â·  12Comments

techtonik picture techtonik  Â·  12Comments

johang picture johang  Â·  10Comments

doadin picture doadin  Â·  4Comments