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 

linking problem on MSVC

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



Joined: 12 Dec 2010
Posts: 5

PostPosted: Sun Dec 12, 2010 9:10 pm    Post subject: linking problem on MSVC Reply with quote

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



Joined: 12 Dec 2010
Posts: 5

PostPosted: Sun Dec 12, 2010 9:13 pm    Post subject: Reply with quote

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


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sun Dec 12, 2010 11:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
poy



Joined: 12 Dec 2010
Posts: 5

PostPosted: Mon Dec 13, 2010 4:13 pm    Post subject: Reply with quote

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


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Mon Dec 13, 2010 4:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
tj74alcott



Joined: 31 May 2011
Posts: 1

PostPosted: Tue May 31, 2011 8:53 am    Post subject: Reply with quote

I think it's kinda cool.
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 -> miniupnpc 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.