main.cpp error during make. Ubuntu 16.04 with boost 1.77 #24619

issue cvcook7 opened this issue on March 20, 2022
  1. cvcook7 commented at 6:55 AM on March 20, 2022: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    Does anyone know how to address the rpcserver.cpp error during the make process?

    I am using Ubuntu 16.04 with the default boost 1.58.

      CXX      rpcserver.o
    rpcserver.cpp:447:102: error: wrong number of template arguments (2, should be 1)
     static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
                                                                                                          ^
    In file included from /usr/local/include/boost/asio.hpp:30,
                     from rpcprotocol.h:15,
                     from rpcserver.h:10,
                     from rpcserver.cpp:6:
    /usr/local/include/boost/asio/basic_socket_acceptor.hpp:73:7: note: provided for ‘template<class Protocol> class boost::asio::basic_socket_acceptor’
     class basic_socket_acceptor
           ^~~~~~~~~~~~~~~~~~~~~
    rpcserver.cpp:447:104: error: template argument 1 is invalid
     static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
                                                                                                            ^
    rpcserver.cpp:457:95: error: wrong number of template arguments (2, should be 1)
     static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
    
    

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    System information Ubuntu 16.04, default boost 1.58 installed.

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. cvcook7 added the label Bug on Mar 20, 2022
  3. hebasto commented at 7:04 AM on March 20, 2022: member

    Ubuntu 16.04, default boost 1.58 installed.

    The minimum required Boost is 1.64.0 since v22.0. To build Bitcoin Core on your system try to build with depends.

  4. hebasto added the label Questions and Help on Mar 20, 2022
  5. hebasto removed the label Bug on Mar 20, 2022
  6. cvcook7 commented at 7:59 AM on March 20, 2022: none

    Thanks. I have removed the Boost 1.58 and manually installed by Ubuntu 16.04 with Boost 1.77.

    Now, I have a new error with the main.cpp during make. Does anyone know how to address this main.cpp issue?

    main.cpp: In function ‘void RegisterWallet(CWalletInterface*)’:
    main.cpp:152:98: error: ‘_1’ was not declared in this scope
         g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2, _3));
    
    
  7. cvcook7 renamed this:
    rpcserver.cpp error during make
    main.cpp error during make. Ubuntu 16.04 with boost 1.77
    on Mar 20, 2022
  8. hebasto commented at 8:09 AM on March 20, 2022: member

    @cvcook7

    What version of source are you trying to build (a branch, or a tag, or a commit)?

    What are options you provided to the configure script?

    Have you successfully built with depends?

  9. cvcook7 commented at 2:15 PM on March 20, 2022: none

    Hi @hebasto ,

    Thanks for your reply. I have actually found a way to solve the problem. I just needed to add the following to the main.cpp so that it could work with my boost 1.77.

    #include <boost/bind/bind.hpp> 
    using namespace boost::placeholders;
    

    I think it is because the Bind placeholders (_1, _2, ...) in the global namespace are deprecated in newer versions of boost. Thanks.

  10. cvcook7 closed this on Mar 20, 2022

  11. fanquake locked this on Apr 19, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me