View previous topic :: View next topic |
Author |
Message |
woobert
Joined: 02 Apr 2008 Posts: 3
|
Posted: Wed Apr 02, 2008 4:36 am Post subject: libnatpmp for windows? |
|
|
Anyone get this compiled for windows? |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
Posted: Wed Apr 02, 2008 3:36 pm Post subject: Re: libnatpmp for windows? |
|
|
woobert wrote: | Anyone get this compiled for windows? |
Hum I haven't tried yet. Please post the errors you're having if you tried
thanks _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
woobert
Joined: 02 Apr 2008 Posts: 3
|
Posted: Wed Apr 02, 2008 4:13 pm Post subject: Output from make using Mingw32 |
|
|
$ make natpmpc-static
gcc -O -fPIC -Wall -c -o natpmpc.o natpmpc.c
natpmpc.c:1: warning: -fPIC ignored for target (all code is position independent )
natpmpc.c:20:24: netinet/in.h: No such file or directory
natpmpc.c:21:23: arpa/inet.h: No such file or directory
In file included from natpmpc.c:22:
natpmp.h:28: error: syntax error before "in_addr_t"
natpmp.h:28: warning: no semicolon at end of struct or union
natpmp.h:34: error: syntax error before '}' token
natpmp.h:34: warning: type defaults to `int' in declaration of `natpmp_t'
natpmp.h:34: warning: data definition has no type or storage class
natpmp.h:37: error: syntax error before "uint16_t"
natpmp.h:37: warning: no semicolon at end of struct or union
natpmp.h:38: warning: type defaults to `int' in declaration of `resultcode'
natpmp.h:38: warning: data definition has no type or storage class
natpmp.h:39: error: syntax error before "epoch"
natpmp.h:39: warning: type defaults to `int' in declaration of `epoch'
natpmp.h:39: warning: data definition has no type or storage class
natpmp.h:43: error: field `addr' has incomplete type
natpmp.h:46: error: syntax error before "uint16_t"
natpmp.h:46: warning: no semicolon at end of struct or union
natpmp.h:46: warning: no semicolon at end of struct or union
natpmp.h:47: warning: type defaults to `int' in declaration of `mappedpublicport '
natpmp.h:47: warning: data definition has no type or storage class
natpmp.h:48: error: syntax error before "lifetime"
natpmp.h:48: warning: type defaults to `int' in declaration of `lifetime'
natpmp.h:48: warning: data definition has no type or storage class
natpmp.h:49: warning: type defaults to `int' in declaration of `newportmapping'
natpmp.h:49: warning: data definition has no type or storage class
natpmp.h:50: error: syntax error before '}' token
natpmp.h:51: warning: type defaults to `int' in declaration of `natpmpresp_t'
natpmp.h:51: warning: data definition has no type or storage class
natpmp.h:111: error: syntax error before '*' token
natpmp.h:119: error: syntax error before '*' token
natpmp.h:127: error: syntax error before '*' token
natpmp.h:141: error: syntax error before '*' token
natpmp.h:153: error: syntax error before '*' token
natpmp.h:172: error: syntax error before '*' token
natpmpc.c: In function `main':
natpmpc.c:27: error: syntax error before "natpmp"
natpmpc.c:32: error: `fd_set' undeclared (first use in this function)
natpmpc.c:32: error: (Each undeclared identifier is reported only once
natpmpc.c:32: error: for each function it appears in.)
natpmpc.c:32: error: syntax error before "fds"
natpmpc.c:34: error: `natpmp' undeclared (first use in this function)
natpmpc.c:45: warning: implicit declaration of function `FD_ZERO'
natpmpc.c:45: error: `fds' undeclared (first use in this function)
natpmpc.c:46: warning: implicit declaration of function `FD_SET'
natpmpc.c:48: warning: implicit declaration of function `select'
natpmpc.c:48: error: `FD_SETSIZE' undeclared (first use in this function)
natpmpc.c:49: error: `response' undeclared (first use in this function)
natpmpc.c:60: warning: implicit declaration of function `inet_ntoa'
natpmpc.c:60: warning: format argument is not a pointer (arg 2)
make: *** [natpmpc.o] Error 1 |
|
Back to top |
|
 |
woobert
Joined: 02 Apr 2008 Posts: 3
|
Posted: Wed Apr 02, 2008 6:31 pm Post subject: progress? |
|
|
well, I've messed around trying to change the includes, etc.
The two real issues I've run into are:
the definition of getdefaultgateway on windows...
and
the use of fcntl in initnatpmp which will need to be replaced with the windows equivalent... (which I know nothing about!). I commented out those two calls to see what else was breaking the build, and have it at least compiling with everything except the getdefaultgateway, since it is undefined for windows.
Let me know if you'd like to see my changes (I'm sure they're not fixes, but at least made most the compilation errors go away)
Steve |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
Posted: Thu Apr 03, 2008 8:50 am Post subject: Re: progress? |
|
|
woobert wrote: | well, I've messed around trying to change the includes, etc.
The two real issues I've run into are:
the definition of getdefaultgateway on windows...
and
the use of fcntl in initnatpmp which will need to be replaced with the windows equivalent... (which I know nothing about!). I commented out those two calls to see what else was breaking the build, and have it at least compiling with everything except the getdefaultgateway, since it is undefined for windows.
Let me know if you'd like to see my changes (I'm sure they're not fixes, but at least made most the compilation errors go away)
Steve |
indeed most of the include should be WIN32 specific.
fcntl call should be replaced by windows ioctl or ioctlsocket... i'll see how to do that.
about getdefaultgateway(), some Windows implementation have to be make from scratch...
some WSAStartup() stuff should be called somewhere too  _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
|
Back to top |
|
 |
mmac119
Joined: 09 Jul 2009 Posts: 7
|
Posted: Thu Jul 09, 2009 5:56 pm Post subject: |
|
|
Has anyone been able to create a .lib file using MSVC using the source files from libnatpmp? |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
Posted: Sat Dec 19, 2009 2:42 pm Post subject: |
|
|
mmac119 wrote: | Has anyone been able to create a .lib file using MSVC using the source files from libnatpmp? |
go on the download page and download libnatpmp-20091219.tar.gz it includes a MS Visual studio 2008 solution in the msvc subdirectory. _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
anosh
Joined: 26 Jan 2015 Posts: 1 Location: london
|
|
Back to top |
|
 |
|