Nmap Development mailing list archives

Re: Ncat on MinGW - report


From: Jacek Wielemborek <wielemborekj1 () gmail com>
Date: Sun, 11 Aug 2013 22:39:02 +0200

2013/8/11 Gisle Vanem <gvanem () broadpark no>:
"Jacek Wielemborek" <wielemborekj1 () gmail com> wrote:

It turns out that Nbase compiles fine without this include, so I just
commented it out. Then, there will be a bunch of this kind of errors:

nbase_winconfig.h:177:24: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'int64_t'


Well, simple. nbase/nbase_winconfig.h should have something like:

#ifndef __MINGW32__
 ..
  typedef signed __int64 int64_t;

I reported this almost 3 years ago:
 http://seclists.org/nmap-dev/2010/q4/707

Interesting. Looks like MinGW wasn't really a priority there. Anyway,
thanks for the #ifndef suggestion, I'll try it out.


In your diff:

+//typedef unsigned __int8 uint8_t;
+//typedef unsigned __int16 uint16_t;
+//typedef unsigned __int32 uint32_t;
+//typedef unsigned __int64 uint64_t;

Doesn't this break other Win32 comilers? Like MSVC.

Yes it did. I didn't care about breaking MSVC in my experiment - if I
wanted to provide autoconf and keep MSVC compability, I wouldn't be
able to do it overnight.


+#include "winsock2.h"


Better make that '#include <winsock2.h>'.


ncat_ssl.c:139:29: fatal error: openssl/applink.c: No such file or
directory
#include <openssl/applink.c>
                            ^


An old story.

Could you elaborate?


/usr/lib64/gcc/i686-w64-mingw32/4.8.1/../../../../i686-w64-mingw32/bin/ld:


Did you make sure '-D_WIN32_WINNT=0x0501' or above?

Do you mean this error:

ncat_main.o: bad reloc address 0x0 in section `.data'

It disappeared in the further linking stage. Anyway, I didn't add the
-D and I have no idea what it does.

Looks like we need some more libs! The ones we're lacking are:
-lwsock32 -lgdi32 -lws2_32. Now, the final problem:


'-lws2_32' should be enough. What symbols do you need from '-lgdi32'?


/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xfb1):
undefined reference to `_imp__CreateDCA@16'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xfc2):
undefined reference to `_imp__CreateCompatibleDC@4'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xfd7):
undefined reference to `_imp__GetDeviceCaps@8'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x1009):
undefined reference to `_imp__CreateCompatibleBitmap@12'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x1020):
undefined reference to `_imp__SelectObject@8'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x1043):
undefined reference to `_imp__GetObjectA@12'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x10e8):
undefined reference to `_imp__BitBlt@36'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x10ff):
undefined reference to `_imp__GetBitmapBits@12'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x117e):
undefined reference to `_imp__DeleteObject@4'
/home/d33tah/workspace/ncat/ncat-mingw/openssl-1.0.1e/usr/local/ssl//lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x1188):
undefined reference to `_imp__DeleteDC@4'
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: