miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

libnatpmp for windows?

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> libnatpmp Compilation/Installation
View previous topic :: View next topic  
Author Message
woobert



Joined: 02 Apr 2008
Posts: 3

PostPosted: Wed Apr 02, 2008 4:36 am    Post subject: libnatpmp for windows? Reply with quote

Anyone get this compiled for windows?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1391

PostPosted: Wed Apr 02, 2008 3:36 pm    Post subject: Re: libnatpmp for windows? Reply with quote

woobert wrote:
Anyone get this compiled for windows?

Hum I haven't tried yet. Please post the errors you're having if you tried Smile
thanks
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
woobert



Joined: 02 Apr 2008
Posts: 3

PostPosted: Wed Apr 02, 2008 4:13 pm    Post subject: Output from make using Mingw32 Reply with quote

$ 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
View user's profile Send private message
woobert



Joined: 02 Apr 2008
Posts: 3

PostPosted: Wed Apr 02, 2008 6:31 pm    Post subject: progress? Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1391

PostPosted: Thu Apr 03, 2008 8:50 am    Post subject: Re: progress? Reply with quote

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 Wink
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1391

PostPosted: Thu Oct 02, 2008 9:23 am    Post subject: Reply with quote

A contributor, Robbie Hanson, has added WIN32 code to libnatpmp !

Sorry to tell it so late but here is the code :
libnatpmp-20080707.tar.gz
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
mmac119



Joined: 09 Jul 2009
Posts: 7

PostPosted: Thu Jul 09, 2009 5:56 pm    Post subject: Reply with quote

Has anyone been able to create a .lib file using MSVC using the source files from libnatpmp?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1391

PostPosted: Sat Dec 19, 2009 2:42 pm    Post subject: Reply with quote

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.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
anosh



Joined: 26 Jan 2015
Posts: 1
Location: london

PostPosted: Mon Jan 26, 2015 7:23 am    Post subject: Reply with quote

Nice post helps me alot thanks

_________________
cert-killer.org Cisco 300-101 Questions PCNSE6 Test 1Y0-301 Practice Exam 1z0-803 Dumps 648-375 Training JN0-1300
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> libnatpmp Compilation/Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.