Nmap Development mailing list archives

Questions about Building a Standalone Ncat Portable for Windows


From: Kary Hui <karyi.hui () gmail com>
Date: Fri, 20 Jul 2018 13:39:32 +0800

Hi Developer,

I follow the steps as mentioned in "Building Ncat Portable for
Windows" (*https://secwiki.org/w/Nmap/Ncat_Portable
<https://secwiki.org/w/Nmap/Ncat_Portable>)*. However, I cannot build a
standalone Ncat. Since I am new to Visual Studio, if you find that
following steps do not make sense, please do let me know.

1) For your information, Visual Studio Express 2013 for Desktop is used.
The source codes of Nmap are downloaded from SVN source code repository on
today (HKT 1200).

2) I successfully build dynamic release version Nmap & Ncat.

3) I select 'Ncat Static' in nmap Solution > Configuration Manager > Active
Solution Configuration and ensure Configurations for nbase, nsock and ncat
are static.

4) I build ncat. Error messages are as below.
Error 5 error C1083: Cannot open include file: 'lua.h': No such file or
directory c:\nmap\ncat\ncat_lua.h 137 1 ncat
Error 6 error C1083: Cannot open include file: 'lua.h': No such file or
directory c:\nmap\ncat\ncat_lua.h 137 1 ncat

5) I update on \nmap\ncat\ncat.vcxproj to add back ..\liblua; for
'Static|Win32'.

6) I click on Rebuild. Error messages are as below.
Error 44 error LNK2005: _memchr already defined in LIBCMT.lib(memchr.obj)
C:\nmap\ncat\MSVCRT.lib(MSVCR120.dll) ncat
......

7) I search on Google. The errors occur because liblua.lib is built by
selecting 'Runtime Library' = 'Multi-threaded DLL (/MD)'. However, other
libraries (i.e. ncat.lib, nsock.lib & nbase.lib) are built by selecting
'Runtime Library' = 'Multi-threaded (/MT)'.

8) No matter I try to rebuild liblua.lib by selecting 'Runtime Library' =
'Multi-threaded (/MT)' or input '/NODEFAULTLIB:libcmt.lib' to linker of
ncat > Command Line, the standalone ncat cannot be built successfully.

Please check. Thank you.

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

Current thread: