masscan icon indicating copy to clipboard operation
masscan copied to clipboard

Windows MinGW-W64 Compile failed

Open XhstormR opened this issue 6 years ago • 4 comments

I downloaded it directly using the latest ZIP package and failed to compile:

XhstormR@DESKTOP-OPN10MH MINGW64 /d/Download/masscan-master
$ mingw32-make.exe
which: no clang in (/c/Users/XhstormR/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/mingw64/bin:/usr/bin:/c/Users/XhstormR/bin:/mingw64/libexec/git-core:/mingw64/bin:/mingw64/mingw/bin:/mingw64/bin:/usr/bin:/c/Users/XhstormR/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/d/Work/mingw64/bin:/d/Work/HUGO/static/uploads/bin:/d/Work/jdk-12.0.1/bin:/c/Users/XhstormR/AppData/Local/Microsoft/WindowsApps:/usr/bin/vendor_perl:/usr/bin/core_perl)
fatal: not a git repository (or any of the parent directories): .git
gcc -g -ggdb -march=x86-64 -Ivs10/include  -Wall -O2 -c src/pixie-timer.c -o tmp/pixie-timer.o
src/pixie-timer.c:58:1: error: conflicting types for 'clock_gettime'
 clock_gettime(int X, struct timeval *tv)
 ^~~~~~~~~~~~~
In file included from D:/Work/mingw64/x86_64-w64-mingw32/include/time.h:332,
                 from src/pixie-timer.c:19:
D:/Work/mingw64/x86_64-w64-mingw32/include/pthread_time.h:88:28: note: previous declaration of 'clock_gettime' was here
 int __cdecl WINPTHREAD_API clock_gettime(clockid_t clock_id, struct timespec *tp);
                            ^~~~~~~~~~~~~
mingw32-make: *** [Makefile:97: tmp/pixie-timer.o] Error 1

Operating environment:

XhstormR@DESKTOP-OPN10MH MINGW64 /d/Download/masscan-master
$ gcc -v
Using built-in specs.
COLLECT_GCC=D:\Work\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=D:/Work/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-win32-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: win32
gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)

XhstormR@DESKTOP-OPN10MH MINGW64 /d/Download/masscan-master
$ mingw32-make.exe  -v
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

XhstormR avatar May 21 '19 07:05 XhstormR

I'm getting the same error with MinGW32.

user@DESKTOP-3ISITBS ~/masscan-master $ make which: clang: unknown command make: git: Command not found gcc -g -ggdb -march=i686 -Ivs10/include -Wall -O2 -c src/pixie-threads.c -o tmp/pixie-threads.o gcc -g -ggdb -march=i686 -Ivs10/include -Wall -O2 -c src/pixie-timer.c -o tmp/pixie-timer.o src/pixie-timer.c:58:1: error: conflicting types for 'clock_gettime' clock_gettime(int X, struct timeval *tv) ^~~~~~~~~~~~~ In file included from src/pixie-timer.c:19: c:\mingw\include\time.h:464:5: note: previous declaration of 'clock_gettime' was here int clock_gettime (clockid_t, struct timespec *); ^~~~~~~~~~~~~ make: *** [tmp/pixie-timer.o] Error 1

wright546 avatar May 28 '19 16:05 wright546

temp solution is to comment line int clock_gettime (clockid_t, struct timespec *); in file c:\mingw\include\time.h

pkrolkgp avatar May 28 '19 22:05 pkrolkgp

I had this issue too and found solution for the latest MinGW version: in mingw-w64\mingw32\i686-w64-mingw32\include\pthread_time.h comment this int __cdecl WINPTHREAD_API clock_gettime(clockid_t clock_id, struct timespec *tp);

And add this to the src/rawsock-getip6.c

#define _WIN32_WINNT _WIN32_WINNT_WIN10
#include <Ws2tcpip.h>

Zerogoki00 avatar Feb 25 '21 20:02 Zerogoki00

This error is still there in the current download from github.

bill-e-ghote avatar Oct 11 '23 11:10 bill-e-ghote