chaincoin-legacy / chaincoin

Chaincoin crypto currency
http://www.chaincoin.org/
Other
60 stars 22 forks source link

boost 1.66 compile error #104

Open ronnylov opened 6 years ago

ronnylov commented 6 years ago

I get following compile error on Arch Linux:

rpcclient.cpp: I funktion ”json_spirit::Object CallRPC(const string&, const Array&)”: rpcclient.cpp:43:58: fel: ingen matchande funktion för anrop av ”boost::asio::ssl::context::context(boost::asio::io_service&, boost::asio::ssl::context_base::method)” ssl::context context(io_service, ssl::context::sslv23); ^ In file included from /usr/include/boost/asio/ssl/context.hpp:757:0, from /usr/include/boost/asio/ssl.hpp:18, from rpcprotocol.h:16, from rpcclient.cpp:9: /usr/include/boost/asio/ssl/impl/context.ipp:326:1: anm: candidate: boost::asio::ssl::context::context(boost::asio::ssl::context&&) context::context(context&& other) ^~~~~~~ /usr/include/boost/asio/ssl/impl/context.ipp:326:1: anm: kandidaten förväntade sig 1 argument, 2 fanns /usr/include/boost/asio/ssl/impl/context.ipp:63:1: anm: candidate: boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) context::context(context::method m) ^~~~~~~ /usr/include/boost/asio/ssl/impl/context.ipp:63:1: anm: kandidaten förväntade sig 1 argument, 2 fanns make[3]: *** [Makefile:1005: rpcclient.o] Fel 1 make[3]: *** Inväntar oavslutade jobb... make[3]: Lämnar katalogen ”/home/ronny/chaincoin/src” make[2]: *** [Makefile:1027: all-recursive] Fel 1 make[2]: Lämnar katalogen ”/home/ronny/chaincoin/src” make[1]: *** [Makefile:732: all] Fel 2 make[1]: Lämnar katalogen ”/home/ronny/chaincoin/src” make: *** [Makefile:512: all-recursive] Fel 1

ronnylov commented 6 years ago

I have previously compiled without problems with boost 1.65. But after upgrading boost I got following error when trying to start wallet:

[ronny@ronnydesktop ~]$ chaincoin-qt chaincoin-qt: error while loading shared libraries: libboost_system.so.1.65.1: cannot open shared object file: No such file or directory

That is why I try to recompile after upgrading boost.

ronnylov commented 6 years ago

Maybe same as this issue? https://github.com/zetacoin/zetacoin/issues/12

ronnylov commented 6 years ago

Using similar patches from zetacoin on files rpcserver.cpp and rpcclient.cpp solved the build problem.

ronnylov commented 6 years ago
---rpcserver.cpp.orig   2018-01-13 13:20:01.122913148 +0100
+++ rpcserver.cpp   2018-01-13 13:45:03.374383779 +0100
@@ -442,8 +442,8 @@
 void ServiceConnection(AcceptedConnection *conn);

 // Forward declaration required for RPCListen
-template <typename Protocol, typename SocketAcceptorService>
-static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
+template <typename Protocol>
+static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol> > acceptor,
                              ssl::context& context,
                              bool fUseSSL,
                              boost::shared_ptr< AcceptedConnection > conn,
@@ -452,8 +452,8 @@
 /**
  * Sets up I/O resources to accept and handle a new connection.
  */
-template <typename Protocol, typename SocketAcceptorService>
-static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
+template <typename Protocol>
+static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol> > acceptor,
                    ssl::context& context,
                    const bool fUseSSL)
 {
@@ -463,7 +463,7 @@
     acceptor->async_accept(
             conn->sslStream.lowest_layer(),
             conn->peer,
-            boost::bind(&RPCAcceptHandler<Protocol, SocketAcceptorService>,
+       boost::bind(&RPCAcceptHandler<Protocol>,
                 acceptor,
                 boost::ref(context),
                 fUseSSL,
@@ -475,8 +475,8 @@
 /**
  * Accept and handle incoming connection.
  */
-template <typename Protocol, typename SocketAcceptorService>
-static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
+template <typename Protocol>
+static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol> > acceptor,
                              ssl::context& context,
                              const bool fUseSSL,
                              boost::shared_ptr< AcceptedConnection > conn,
@@ -543,7 +543,7 @@

     assert(rpc_io_service == NULL);
     rpc_io_service = new asio::io_service();
-    rpc_ssl_context = new ssl::context(*rpc_io_service, ssl::context::sslv23);
+    rpc_ssl_context = new ssl::context(ssl::context::sslv23);

     const bool fUseSSL = GetBoolArg("-rpcssl", false);

@@ -562,7 +562,7 @@
         else LogPrintf("ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string());

         string strCiphers = GetArg("-rpcsslciphers", "TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH");
-        SSL_CTX_set_cipher_list(rpc_ssl_context->impl(), strCiphers.c_str());
+   SSL_CTX_set_cipher_list(rpc_ssl_context->native_handle(), strCiphers.c_str());
     }

     // Try a dual IPv6/IPv4 socket, falling back to separate IPv4 and IPv6 sockets
--- rpcclient.cpp.old   2018-01-13 13:56:44.562265626 +0100
+++ rpcclient.cpp   2018-01-13 13:54:12.739824795 +0100
@@ -40,7 +40,7 @@
     // Connect to localhost
     bool fUseSSL = GetBoolArg("-rpcssl", false);
     asio::io_service io_service;
-    ssl::context context(io_service, ssl::context::sslv23);
+    ssl::context context(ssl::context::sslv23);
     context.set_options(ssl::context::no_sslv2 | ssl::context::no_sslv3);
     asio::ssl::stream<asio::ip::tcp::socket> sslStream(io_service, context);
     SSLIOStreamDevice<asio::ip::tcp> d(sslStream, fUseSSL);
curtcurt871 commented 3 years ago

[](https://github.com/chaincoin-legacy/chaincoin/issues/112#issue-309777664) ##