# Mldonkey3.10 can't use upnp



## macafee (Oct 22, 2011)

I wanted to install the mldonkey 3.10 from the ports with '--enable-upnp-natpmp' arguement. But it reported that error. 

```
+ cc -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing -fPIC -c -I /byterun
 -o src/utils/net/upnp_stubs.o -O2 -pipe -fno-strict-aliasing    -I/usr/local/include -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib
 -I/usr/local/include -I/usr/local/include -I/usr/local/include  -I'/usr/local/lib/ocaml' 'src/utils/net/upnp_stubs.c'
src/utils/net/upnp_stubs.c: In function 'natpmpPulse':
src/utils/net/upnp_stubs.c:504: error: too few arguments to function 'initnatpmp'
gmake: *** [src/utils/net/upnp_stubs.o] Error 2
*** Error code 1
```
Before this, I have installed the miniupnpc and libnatpmp from the ports. I use FreeBSD 8.2-RELEASE amd64 version. 
How to fix this problem?


----------



## oops (Oct 22, 2011)

mldonkey-3.1.0 wants initnatpmp() prototype from libnatpmp-20100202 according to its configure script. So, you can either add the missing args or use libnatpmp-20100202. As the port does not yet support --enable-upnp-natpmp you're asking a homework question.


```
$ less mldonkey-3.1.0/config/configure.in
if test "$UPNP_NATPMP_FORCE" = "yes"; then
        UPNP_NATPMP=yes
        cd $PATCH_DIR
        $WGET http://miniupnp.tuxfamily.org/files/miniupnpc-1.4.20100609.tar.gz
        $WGET http://miniupnp.tuxfamily.org/files/libnatpmp-20100202.tar.gz

$ grep 'initnatpmp.*;' libnatpmp-*/natpmp.h
libnatpmp-20100202/natpmp.h:LIBSPEC int initnatpmp(natpmp_t * p);
libnatpmp-20101211/natpmp.h:LIBSPEC int initnatpmp(natpmp_t * p);
libnatpmp-20110103/natpmp.h:LIBSPEC int initnatpmp(natpmp_t * p, int forcegw, in_addr_t forcedgw);
libnatpmp-20110527/natpmp.h:LIBSPEC int initnatpmp(natpmp_t * p, int forcegw, in_addr_t forcedgw);
libnatpmp-20110808/natpmp.h:LIBSPEC int initnatpmp(natpmp_t * p, int forcegw, in_addr_t forcedgw);

$ grep -B1 initnatpmp libnatpmp-20110103/Changelog.txt
2011/01/03:
  Added an argument to initnatpmp() in order to force the gateway to be used
```


----------



## macafee (Oct 22, 2011)

Thanks oops! After I intalled the libnatpmp-20101211.tbz, that's everything is ok! I think the mldonkey's port maintainer should add UPNP Option to this port.


----------

