Anoncoin / anoncoin

Anoncoin (ANC) is a peer-to-peer digital cryptocurrency that focuses on privacy and anonymity for its users. Created in June 2013, it is the first and only currency to have built-in support for both the I2P darknet and Tor network that conceal the IP address of the user.
https://anoncoin.net
MIT License
36 stars 19 forks source link

Compiling latest release on a Mac #15

Closed switzer closed 6 years ago

switzer commented 6 years ago

I am trying to compile the latest release (https://github.com/Anoncoin/anoncoin/releases/tag/5e441d8) to work on my Mac.

Per a Slack chat, I am adding all of the errors I get during the process here:

When running make:

Making all in src
  CXX      anoncoind-anoncoind.o
  CXX      libanoncoin_server_a-alert.o
  CXX      libanoncoin_server_a-bloom.o
  CXX      libanoncoin_server_a-chain.o
  CXX      libanoncoin_server_a-checkpoints.o
  CXX      libanoncoin_server_a-init.o
init.cpp:1369:21: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    if (nTotalCache < (nMinDbCache << 20))
        ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
init.cpp:1371:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    else if (nTotalCache > (nMaxDbCache << 20))
             ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
2 warnings generated.
  CXX      libanoncoin_server_a-leveldbwrapper.o
  CXX      libanoncoin_server_a-main.o
main.cpp:4150:18: warning: unused variable 'fFromChanged' [-Wunused-variable]
            bool fFromChanged = addrFrom.CheckAndSetGarlicCat();
                 ^
main.cpp:4674:22: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const unsigned int' [-Wsign-compare]
        if( nInvSize > MAX_INV_SZ ) {
            ~~~~~~~~ ^ ~~~~~~~~~~
2 warnings generated.
  CXX      libanoncoin_server_a-merkleblock.o
  CXX      libanoncoin_server_a-miner.o
  CXX      libanoncoin_server_a-net.o
net.cpp:1406:15: error: no matching function for call to 'upnpDiscover'
    devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
              ^~~~~~~~~~~~
/usr/local/include/miniupnpc/miniupnpc.h:63:1: note: candidate function not viable: requires 7 arguments, but 6 were provided
upnpDiscover(int delay, const char * multicastif,
^
1 error generated.
make[2]: *** [libanoncoin_server_a-net.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Aside from the warnings, the key error is that miniupnpc has been modified in the OS since this code has been tested on a Mac.

I ran configure without miniupnpc to see how it goes:

./configure --without-miniupnpc

Output of make is as follows:

Making all in src
  CXX      anoncoind-anoncoind.o
  CXX      libanoncoin_server_a-alert.o
  CXX      libanoncoin_server_a-bloom.o
  CXX      libanoncoin_server_a-chain.o
  CXX      libanoncoin_server_a-checkpoints.o
  CXX      libanoncoin_server_a-init.o
init.cpp:1369:21: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    if (nTotalCache < (nMinDbCache << 20))
        ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
init.cpp:1371:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    else if (nTotalCache > (nMaxDbCache << 20))
             ~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
2 warnings generated.
  CXX      libanoncoin_server_a-leveldbwrapper.o
  CXX      libanoncoin_server_a-main.o
main.cpp:4150:18: warning: unused variable 'fFromChanged' [-Wunused-variable]
            bool fFromChanged = addrFrom.CheckAndSetGarlicCat();
                 ^
main.cpp:4674:22: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const unsigned int' [-Wsign-compare]
        if( nInvSize > MAX_INV_SZ ) {
            ~~~~~~~~ ^ ~~~~~~~~~~
2 warnings generated.
  CXX      libanoncoin_server_a-merkleblock.o
  CXX      libanoncoin_server_a-miner.o
  CXX      libanoncoin_server_a-net.o
net.cpp:2080:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
  CXX      libanoncoin_server_a-noui.o
  CXX      libanoncoin_server_a-pow.o
pow.cpp:910:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
pow.cpp:960:49: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
            assert( vTipFilterWithHeader.size() == nTipFilterBlocks + 1 );
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
pow.cpp:1021:36: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
    assert( vIndexTipFilter.size() == nTipFilterBlocks );            //! The array of strutures is constant in size and assumed.
            ~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
pow.cpp:1415:20: warning: unused variable 'dTimeErrorAt' [-Wunused-variable]
            double dTimeErrorAt, dDiffErrorAt;
                   ^
pow.cpp:1417:20: warning: unused variable 'dPiLog2' [-Wunused-variable]
            double dPiLog2, dPidLog2;
                   ^
pow.cpp:1415:34: warning: unused variable 'dDiffErrorAt' [-Wunused-variable]
            double dTimeErrorAt, dDiffErrorAt;
                                 ^
pow.cpp:1417:29: warning: unused variable 'dPidLog2' [-Wunused-variable]
            double dPiLog2, dPidLog2;
                            ^
pow.cpp:1544:100: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int32_t' (aka 'int') [-Wsign-compare]
    if( pIndexAtTip == NULL || pIndexAtTip->nHeight < nTipFilterBlocks || (nHeight != 0 && nHeight <= nTipFilterBlocks ) )
                                                                                           ~~~~~~~ ^  ~~~~~~~~~~~~~~~~
pow.cpp:1552:33: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'const int' [-Wsign-compare]
    if( nHeight == 0 || nHeight > pIndexAtTip->nHeight ) {
                        ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~
pow.cpp:1558:40: warning: comparison of integers of different signs: 'const int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
        while( pIndexAtHeight->nHeight > nHeight )
               ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~
10 warnings generated.
  CXX      libanoncoin_server_a-rest.o
  CXX      libanoncoin_server_a-rpcblockchain.o
  CXX      libanoncoin_server_a-rpcmining.o
rpcmining.cpp:311:10: warning: unused variable 'fClearSlowMRU' [-Wunused-variable]
    bool fClearSlowMRU = false;
         ^
1 warning generated.
  CXX      libanoncoin_server_a-rpcmisc.o
  CXX      libanoncoin_server_a-rpcnet.o
  CXX      libanoncoin_server_a-rpcrawtransaction.o
rpcrawtransaction.cpp:610:27: warning: unused variable 'coins' [-Wunused-variable]
            const CCoins *coins = view.AccessCoins(prevHash); // this is certainly allowed to fail
                          ^
1 warning generated.
  CXX      libanoncoin_server_a-rpcserver.o
rpcserver.cpp:529:49: error: too many template arguments for class template 'basic_socket_acceptor'
static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
                                                ^                               ~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/asio/basic_socket_acceptor.hpp:73:7: note: template is declared here
class basic_socket_acceptor
      ^
rpcserver.cpp:539:42: error: too many template arguments for class template 'basic_socket_acceptor'
static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
                                         ^                               ~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/asio/basic_socket_acceptor.hpp:73:7: note: template is declared here
class basic_socket_acceptor
      ^
rpcserver.cpp:562:49: error: too many template arguments for class template 'basic_socket_acceptor'
static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
                                                ^                               ~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/asio/basic_socket_acceptor.hpp:73:7: note: template is declared here
class basic_socket_acceptor
      ^
rpcserver.cpp:656:27: error: no matching constructor for initialization of 'ssl::context'
    rpc_ssl_context = new ssl::context(*rpc_io_service, ssl::context::sslv23);
                          ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/asio/ssl/impl/context.ipp:63:10: note: candidate constructor not viable: requires single argument 'm', but 2 arguments were provided
context::context(context::method m)
         ^
/usr/local/include/boost/asio/ssl/context.hpp:36:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class context
      ^
rpcserver.cpp:675:50: error: no member named 'impl' in 'boost::asio::ssl::context'
        SSL_CTX_set_cipher_list(rpc_ssl_context->impl(), strCiphers.c_str());
                                ~~~~~~~~~~~~~~~  ^
rpcserver.cpp:735:13: error: no matching function for call to 'RPCListen'
            RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
            ^~~~~~~~~
rpcserver.cpp:1099:20: warning: unused variable 'uintPOWlimit' [-Wunused-variable]
    const uint256 &uintPOWlimit = Params().ProofOfWorkLimit( CChainParams::ALGO_SCRYPT );
                   ^
1 warning and 6 errors generated.
make[2]: *** [libanoncoin_server_a-rpcserver.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

I am happy to work with someone live with this. I will add to this issue as I fix problems.

switzer commented 6 years ago

The project compiles if you install boost from scratch:

brew uninstall boost
brew install --build-from-source --HEAD boost

I am updating the documentation about the OSX build and will add separate issues for the other problems that exist.