View previous topic :: View next topic |
Author |
Message |
poy
Joined: 12 Dec 2010 Posts: 5
|
Posted: Sun Dec 12, 2010 9:10 pm Post subject: linking problem on MSVC |
|
|
hi,
the latest miniupnpc has a problem linking with MSVC, strncasecmp being unresolved.
copy-pasting the following:
Code: |
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define strncasecmp _memicmp
#else /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
#define strncasecmp memicmp
#endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
|
from miniupnpc.c to miniwget.c solves it.
thanks! |
|
Back to top |
|
|
poy
Joined: 12 Dec 2010 Posts: 5
|
Posted: Sun Dec 12, 2010 9:13 pm Post subject: |
|
|
it is also a good idea to add:
Code: |
#ifdef strncasecmp
#undef strncasecmp
#endif
|
right before because when building on MinGW, i get the following warnings:
Quote: |
miniupnpc\miniupnpc.c:32:0: warning: "strncasecmp" redefined
/usr/i686-w64-mingw32/sys-root/mingw/include/string.h:104:0: note: this is the location of the previous definition
|
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Sun Dec 12, 2010 11:51 pm Post subject: |
|
|
poy wrote: |
right before because when building on MinGW, i get the following warnings:
Quote: |
miniupnpc\miniupnpc.c:32:0: warning: "strncasecmp" redefined
/usr/i686-w64-mingw32/sys-root/mingw/include/string.h:104:0: note: this is the location of the previous definition
|
|
I dont have this error when building with MinGW. _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
poy
Joined: 12 Dec 2010 Posts: 5
|
Posted: Mon Dec 13, 2010 4:13 pm Post subject: |
|
|
miniupnp wrote: | poy wrote: |
right before because when building on MinGW, i get the following warnings:
Quote: |
miniupnpc\miniupnpc.c:32:0: warning: "strncasecmp" redefined
/usr/i686-w64-mingw32/sys-root/mingw/include/string.h:104:0: note: this is the location of the previous definition
|
|
I dont have this error when building with MinGW. |
that is probably because i'm using the MinGW-w64 in Cygwin, not vanilla MinGW. my string.h includes the following def:
Code: | #define strncasecmp _strnicmp |
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Mon Dec 13, 2010 4:51 pm Post subject: |
|
|
I will test to use :
Code: |
#ifndef strncasecmp
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define strncasecmp _memicmp
#else /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
#define strncasecmp memicmp
#endif /* defined(_MSC_VER) && (_MSC_VER >= 1400) */
#endif /* #ifndef strncasecmp */
|
_________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
tj74alcott
Joined: 31 May 2011 Posts: 1
|
Posted: Tue May 31, 2011 8:53 am Post subject: |
|
|
I think it's kinda cool. |
|
Back to top |
|
|
|