Nmap Development mailing list archives

Re: nmap-4.02CSW failed build on Windows XP built in VS 2005 Express


From: Fyodor <fyodor () insecure org>
Date: Thu, 20 Apr 2006 19:06:16 -0700

On Wed, Apr 19, 2006 at 12:07:56AM -0400, kx wrote:

would you please edit your VS nmap.sln to add the following
define statement to all projects for all build configurations?  It
would save me from putting them in each time.

/D "_CRT_SECURE_NO_DEPRECATE"

Silly Microsoft.  Would you test whether this patch resolves the problem?

--- nbase/nbase_winconfig.h     (revision 3051)
+++ nbase/nbase_winconfig.h     (working copy)
@@ -142,6 +142,10 @@
 #define HAVE_AF_INET6 1
 #define HAVE_SOCKADDR_STORAGE 1

+/* Without this, Windows will give us all sorts of crap about using functions
+   like strcpy() even if they are done safely */
+#define _CRT_SECURE_NO_DEPRECATE 1
+
 #ifdef __GNUC__
 #define bzero(addr, num) __builtin_memset (addr, '\0', num)
 #else


pow(int,int) is no longer in math.h in VS 2005
http://msdn2.microsoft.com/en-US/library/da60x087(VS.80).aspx

No sure what you prefer for lines 721 and 723 of tcpip.cc? Could be:

(int) pow((float)5, failed));

Does the following patch remove the problem?

--- tcpip.cc    (revision 3224)
+++ tcpip.cc    (working copy)
@@ -718,9 +718,9 @@
           "*BSD:  If you are getting device not configured, you need to recompile your kernel with Berkeley Packet 
Filter support.  If you are getting No such file or directory, try creating the device (eg cd /dev; MAKEDEV <device>; 
or use mknod).\n"
           "SOLARIS:  If you are trying to scan localhost and getting '/dev/lo0: No such file or directory', complain 
to Sun.  I don't think Solaris can support advanced localhost scans.  You can probably use \"-P0 -sT localhost\" 
though.\n\n", pcapdev, snaplen, promisc, to_ms, err0r);
       } else {
-       error("pcap_open_live(%s, %d, %d, %d) FAILED. Reported error: %s.  Will wait %d seconds then retry.", pcapdev, 
snaplen, promisc, to_ms, err0r, (int) pow(5, failed));
+       error("pcap_open_live(%s, %d, %d, %d) FAILED. Reported error: %s.  Will wait %d seconds then retry.", pcapdev, 
snaplen, promisc, to_ms, err0r, (int) pow(5.0, failed));
       }
-      sleep((int) pow(5, failed));
+      sleep((int) pow(5.0, failed));
     }
   } while (!pt);


Thanks,
Fyodor


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev


Current thread: