Build fails on Debian Jessie

Hi, I've noticed that the build fails on Debian Jessie with the following errors:

~/Programs/cpp-ethereum-build$ cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/u1/Programs/cpp-ethereum-build
[email protected]:~/Programs/cpp-ethereum-build$ make
[ 4%] Building CXX object libethereum/CMakeFiles/ethereum.dir/PeerNetwork.cpp.o
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp: In constructor ‘eth::UPnP::UPnP()’:
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:542:128: error: too many arguments to function ‘UPNPDev* upnpDiscover(int, const char*, const char*, int)’
devlist = upnpDiscover(2000, NULL/*multicast interface*/, NULL/*minissdpd socket path*/, 0/*sameport*/, 0/*ipv6*/, &upnperror);
^
In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:26:0:
/usr/include/miniupnpc/miniupnpc.h:45:26: note: declared here
LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif,
^
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp: In member function ‘int eth::UPnP::addRedirect(const char*, int)’:
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:599:123: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, port_str, addr, "ethereum", "TCP", NULL, NULL);
^
In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
/usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
^
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:603:120: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, NULL, addr, "ethereum", "TCP", NULL, NULL);
^
In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
/usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
^
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:608:120: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, NULL, port_str, addr, "ethereum", "TCP", NULL, NULL);
^
In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
/usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
^
/home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:613:116: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, NULL, NULL, addr, "ethereum", "TCP", NULL, NULL);
^
In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
/usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
^
make[2]: *** [libethereum/CMakeFiles/ethereum.dir/PeerNetwork.cpp.o] Error 1
make[1]: *** [libethereum/CMakeFiles/ethereum.dir/all] Error 2
make: *** [all] Error 2

Comments

  • accapeaccape Member Posts: 66
    You need an older version of libminiupnpc (specifically 1.6.2)
  • grantgrant Member Posts: 24
    Thanks accape, I'll give that a shot.
  • grantgrant Member Posts: 24
    Hmmm. Jessie has 1.5-2 and sid has 1.6-3.
  • arckearcke Member Posts: 34
    On wheezy, I downloaded http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.6.20120509.tar.gz and installed it with prefix $HOME.

    After this prefix cmake and make commands with `CPPFLAGS="-I ~/include" LDFLAGS="-L ~/lib"' and it should work.
  • grantgrant Member Posts: 24
    Hey, I tried your recommendation, but it didn't work. Here is what I did.

    1. I installed miniupnpc like this:

    $ wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.6.20120509.tar.gz
    $ tar xzf miniupnpc-1.6.20120509.tar.gz
    $ cd miniupnpc-1.6.20120509

    $ INSTALLPREFIX=$HOME make
    $ INSTALLPREFIX=$HOME make install

    2. I followed the install instructions as per Building.md, but instead of using just make and cmake, I would prepend it with the flags as described by arcke.
    For example, nstead of this:
    $ make
    I did this:
    $ CPPFLAGS="-I ~/include" LDFLAGS="-L ~/lib" make

    Another example, instead of this:
    $ cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release
    I did this:
    $ CPPFLAGS="-I ~/include" LDFLAGS="-L ~/lib" cmake ../cpp-ethereum -DCMAKE_BUILD_TYPE=Release
  • grantgrant Member Posts: 24
    The resulting error I got was:

    ~/Programs/cpp-ethereum-build$ CPPFLAGS="-I ~/include" LDFLAGS="-L ~/lib" make
    Scanning dependencies of target ethereum
    [ 4%] Building CXX object libethereum/CMakeFiles/ethereum.dir/RLP.cpp.o
    [ 8%] Building CXX object libethereum/CMakeFiles/ethereum.dir/AddressState.cpp.o
    [ 12%] Building CXX object libethereum/CMakeFiles/ethereum.dir/TransactionQueue.cpp.o
    [ 16%] Building CXX object libethereum/CMakeFiles/ethereum.dir/TrieDB.cpp.o
    [ 20%] Building CXX object libethereum/CMakeFiles/ethereum.dir/PeerNetwork.cpp.o
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp: In constructor ‘eth::UPnP::UPnP()’:
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:542:128: error: too many arguments to function ‘UPNPDev* upnpDiscover(int, const char*, const char*, int)’
    devlist = upnpDiscover(2000, NULL/*multicast interface*/, NULL/*minissdpd socket path*/, 0/*sameport*/, 0/*ipv6*/, &upnperror);
    ^
    In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:26:0:
    /usr/include/miniupnpc/miniupnpc.h:45:26: note: declared here
    LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif,
    ^
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp: In member function ‘int eth::UPnP::addRedirect(const char*, int)’:
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:599:123: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
    r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, port_str, addr, "ethereum", "TCP", NULL, NULL);
    ^
    In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
    /usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
    UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
    ^
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:603:120: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
    r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, NULL, addr, "ethereum", "TCP", NULL, NULL);
    ^
    In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
    /usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
    UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
    ^
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:608:120: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
    r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, NULL, port_str, addr, "ethereum", "TCP", NULL, NULL);
    ^
    In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
    /usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
    UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
    ^
    /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:613:116: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
    r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, NULL, NULL, addr, "ethereum", "TCP", NULL, NULL);
    ^
    In file included from /home/u1/Programs/cpp-ethereum/libethereum/PeerNetwork.cpp:525:0:
    /usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
    UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
    ^
    make[2]: *** [libethereum/CMakeFiles/ethereum.dir/PeerNetwork.cpp.o] Error 1
    make[1]: *** [libethereum/CMakeFiles/ethereum.dir/all] Error 2
    make: *** [all] Error 2
  • grantgrant Member Posts: 24
    Ok, I added a sid repo to debian, and used that version of miniupnp-dev. It seems to be building now...
Sign In or Register to comment.