Nmap Development mailing list archives

RE: Compiling Nmap on Visual C++ 2005 Express


From: "Sina Bahram" <sbahram () nc rr com>
Date: Sun, 27 Nov 2005 23:13:08 -0500

Hi Fyodor and others,
 
After following the instructions in the below email: I still get the
following four errors:

Error   349     error LNK2001: unresolved external symbol __imp__pcre_free
service_scan.obj        
Error   350     error LNK2019: unresolved external symbol __imp__pcre_study
referenced in function "public: void __thiscall
ServiceProbeMatch::InitMatch(char const *,int)"
(?InitMatch@ServiceProbeMatch@@QAEXPBDH@Z)      service_scan.obj        
Error   351     error LNK2019: unresolved external symbol
__imp__pcre_compile referenced in function "public: void __thiscall
ServiceProbeMatch::InitMatch(char const *,int)"
(?InitMatch@ServiceProbeMatch@@QAEXPBDH@Z)      service_scan.obj        
Error   352     error LNK2019: unresolved external symbol __imp__pcre_exec
referenced in function "public: struct MatchDetails const * __thiscall
ServiceProbeMatch::testMatch(unsigned char const *,int)"
(?testMatch@ServiceProbeMatch@@QAEPBUMatchDetails@@PBEH@Z)
service_scan.obj        
Error   353     fatal error LNK1120: 4 unresolved externals
.\Debug/nmap.exe        

I am running win xp sp2 using vs2k5

Thank you for any advice on fixing this.

Take care,
Sina

-----Original Message-----
From: nmap-dev-bounces () insecure org [mailto:nmap-dev-bounces () insecure org]
On Behalf Of Fyodor
Sent: Monday, November 21, 2005 10:22 PM
To: kx
Cc: nmap-dev () insecure org
Subject: Re: Compiling Nmap on Visual C++ 2005 Express

On Mon, Nov 21, 2005 at 12:36:20PM -0500, kx wrote:
I was curious if anyone had successfully compiled Nmap on Visual C++
2005 Express using the Platform SDK. I am a Visual Studios novice, but 
I thought if we could get Nmap compiling in Express, it would open up 
Windows development to a lot of hobbyist programmers like myself, who 
are just too cheap to buy the full version.

Neat!  I hadn't heard abou this (currently free) offering from MS.
The error you noted is:

Linking...
LIBCMT.lib(strnicmp.obj) : error LNK2005: __strnicmp already defined 
in nbase.lib(strcasecmp.obj) .\Release/nmap.exe : fatal error LNK1169: 
one or more multiply defined symbols found

It is possible that this is a link order error, as you suggest.
Alternatively, maybe you just need to add:

#define HAVE_STRNCASECMP 1

to nbase/nbase_winconfig.h, then make clean and recompile.  It looks like
Windows already has a function like strncasecmp called _strnicmp.  So
nbase.h includes:

#define strncasecmp _strnicmp

But for some reason, HAVE_STRNCASECMP is not defined, so Nmap tries to
compile in its own strncasecmp().  strcasecmp.c includes:

#ifndef HAVE_STRNCASECMP
int strncasecmp(const char *s1, const char *s2, size_t n)

But that looks like it is being redefined to:

int _strnicmp(...

And so the linker gets confused because it sees the native _strnicmp() and
the one it compiled from strcasecmp.c.

Please let us know how this goes!

Thanks,
Fyodor


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



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


Current thread: