Nmap Development mailing list archives

Re: Nmap build fails on MSVC 2013 with Windows SDK 10


From: 食肉大灰兔V5 <hsluoyz () gmail com>
Date: Wed, 15 Jun 2016 16:10:07 +0800

Hi list,

I found a workaround:

Add these two macros in nbase_ipv6.h:

#define HAVE_INET_PTON
#define HAVE_INET_NTOP

right before:

#ifndef HAVE_INET_PTON
/* int
 * inet_pton(af, src, dst)
 *      convert from presentation format (which usually means ASCII
printable)
 *      to network format (which is usually some kind of binary format).
 * return:
 *      1 if the address was valid for the specified address family
 *      0 if the address wasn't valid (`dst' is untouched in this case)
 *      -1 if some other error occurred (`dst' is untouched in this case,
too)
 * author:
 *      Paul Vixie, 1996.
 */
int inet_pton(int af, const char *src, void *dst);
#endif /* HAVE_INET_PTON */

#ifndef HAVE_INET_NTOP
/* char *
 * inet_ntop(af, src, dst, size)
 * convert a network format address to presentation format.
 * return:
 * pointer to presentation format address (`dst'), or NULL (see errno).
 * author:
 * Paul Vixie, 1996.
 */
const char *inet_ntop(int af, const void *src, char *dst, size_t size);
#endif /* HAVE_INET_NTOP */



So that the two functions won't be defined again.


Cheers,
Yang

On Wed, Jun 15, 2016 at 3:53 PM, 食肉大灰兔V5 <hsluoyz () gmail com> wrote:

Hi list,

I git cloned the latest source from https://github.com/nmap/nmap/, then
launched mswin32\nmap.sln, and tried to build the Debug Win32 version.

My env is Windows 10 x64 + MSVC 2013 + Windows SDK 10.0.10586 + WDK
10.0.10586

Some errors are:

1>------ Rebuild All started: Project: nbase, Configuration: Debug Win32
------
2>------ Rebuild All started: Project: libpcre, Configuration: Debug Win32
------
3>------ Rebuild All started: Project: libdnet-stripped, Configuration:
Debug Win32 ------
4>------ Rebuild All started: Project: liblua, Configuration: Debug Win32
------
5>------ Rebuild All started: Project: libnetutil, Configuration: Debug
Win32 ------
6>------ Rebuild All started: Project: liblinear, Configuration: Debug
Win32 ------
7>------ Rebuild All started: Project: nmap-update, Configuration: Debug
Win32 ------
1>  strcasecmp.c
6>  dscal.c
6>  dnrm2.c
6>  ddot.c
6>  daxpy.c
6>  Generating Code...
6>  tron.cpp
7>  svn_auth.c
6>  linear.cpp
1>j:\github_repos_others\nmap\nbase\nbase_ipv6.h(164): error C2373:
'inet_pton' : redefinition; different type modifiers
1>          c:\program files (x86)\windows
kits\8.1\include\um\ws2tcpip.h(560) : see declaration of 'inet_pton'
1>j:\github_repos_others\nmap\nbase\nbase_ipv6.h(176): error C2373:
'inet_ntop' : redefinition; different type modifiers
3>  strsep.c
1>          c:\program files (x86)\windows
kits\8.1\include\um\ws2tcpip.h(576) : see declaration of 'inet_ntop'
1>  snprintf.c
3>  strlcpy.c



I did a little search about "ws2tcpip.h", and it exists in several places:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include\WS2tcpip.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\WS2tcpip.h
C:\Program Files (x86)\Windows Kits\8.1\Include\um\WS2tcpip.h
C:\Program Files (x86)\Windows Phone Kits\8.1\Include\ws2tcpip.h
C:\Program Files (x86)\Windows Phone Silverlight
Kits\8.1\Include\ws2tcpip.h

From the error, it seems that Nmap uses SDK 8.1 instead of the 10 version.
I didn't install SDK 8.1 explicitly, but it seems that SDK 10 also installs
some 8.1 files.

I looked at the https://nmap.org/book/inst-windows.html, and it doesn't
see which version SDK I should use. Maybe I'm using the wrong version?
What's the official env for building nmap? MSVC 2013 + SDK 8.1? Thanks.


Cheers,
Yang

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: