Skip to content

Cygwin compile error. #50

@Anandir

Description

@Anandir

Hi everyone, I've tried to compile PRADS under a Cygwin environment for some tests using a Windows machine, but I've got this error:

$ make
You need libpcre-dev and libpcap-dev to compile this program.
make CONFDIR=/usr/local/etc/prads -C src/
make[1]: entering in the folder "/home/Giacomo/prads/src"
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o bstrlib.o bstrlib.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o sig_tcp.o sig_tcp.c
sig_tcp.c: In function ‘grab_name’:
sig_tcp.c:918:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
if (!r || !(s = r->h_name) || !(j = strlen(s))) return "";
^
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o config.o config.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o sys_func.o sys_func.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o assets.o assets.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o prads.o prads.c
prads.c:55:12: warning: ‘optind’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
extern int optind, opterr, optopt; // getopt()
^~~~~~
prads.c:55:20: warning: ‘opterr’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
extern int optind, opterr, optopt; // getopt()
^~~~~~
prads.c:55:28: warning: ‘optopt’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
extern int optind, opterr, optopt; // getopt()
^~~~~~
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o dhcp.o dhcp.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o dump_dns.o dump_dns.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o mac.o mac.c
mac.c: In function ‘arp_check’:
mac.c:335:6: warning: type of ‘eth_hdr’ defaults to ‘int’ [-Wimplicit-int]
void arp_check(eth_hdr, tstamp)
^~~~~~~~~
mac.c:335:6: warning: type of ‘tstamp’ defaults to ‘int’ [-Wimplicit-int]
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o servicefp/servicefp.o servicefp/servicefp.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o servicefp/tcpc.o servicefp/tcpc.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o servicefp/tcps.o servicefp/tcps.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o servicefp/udps.o servicefp/udps.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o ipfp/ipfp.o ipfp/ipfp.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o ipfp/udp_fp.o ipfp/udp_fp.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o ipfp/icmp_fp.o ipfp/icmp_fp.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o cxt.o cxt.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o output-plugins/log_dispatch.o output-plugins/log_dispatch.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o output-plugins/log_stdout.o output-plugins/log_stdout.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o output-plugins/log_file.o output-plugins/log_file.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o output-plugins/log_fifo.o output-plugins/log_fifo.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o output-plugins/log_ringbuffer.o output-plugins/log_ringbuffer.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -c -o output-plugins/log_sguil.o output-plugins/log_sguil.c
cc -O3 -DRELEASE='"-20-g407cf7c"' -DCONFDIR='"/usr/local/etc/prads/"' -D__USE_GNU -o prads bstrlib.o sig_tcp.o config.o sys_func.o assets.o prads.o dhcp.o dump_dns.o mac.o servicefp/servicefp.o servicefp/tcpc.o servicefp/tcps.o servicefp/udps.o ipfp/ipfp.o ipfp/udp_fp.o ipfp/icmp_fp.o cxt.o output-plugins/log_dispatch.o output-plugins/log_stdout.o output-plugins/log_file.o output-plugins/log_fifo.o output-plugins/log_ringbuffer.o output-plugins/log_sguil.o -lpcap -lpcre -lresolv
** dump_dns.o:dump_dns.c:(.text+0xa8): undefined reference to "__ns_parserr"
dump_dns.o:dump_dns.c:(.text+0xed): undefined reference to "__p_type"
dump_dns.o:dump_dns.c:(.text+0xf9): undefined reference to "__p_class"
dump_dns.o:dump_dns.c:(.text+0x1c2): undefined reference to "__ns_name_uncompress"
dump_dns.o:dump_dns.c:(.text+0x225): undefined reference to "__ns_name_uncompress"
dump_dns.o:dump_dns.c:(.text+0x27a): undefined reference to "__ns_name_uncompress"
dump_dns.o:dump_dns.c:(.text+0x42a): undefined reference to "__ns_initparse"
dump_dns.o:dump_dns.c:(.text+0x49e): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x50c): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x519): undefined reference to "__p_rcode"
dump_dns.o:dump_dns.c:(.text+0x524): undefined reference to "_res_opcodes"
dump_dns.o:dump_dns.c:(.text+0x5ad): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x621): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x695): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x709): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x77d): undefined reference to "__ns_msg_getflag"
dump_dns.o:dump_dns.c:(.text+0x7f1): more undefined references to "__ns_msg_getflag" follow
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:100: prads] Error 1 **
make[1]: exit from the folder "/home/Giacomo/prads/src"
make: *** [Makefile:15: build] Error 2

I've used the NPcap files with a symbolic link to the proper name as libpcap substitute.
I've also modified the src/Makefile to point to the proper lib location:

for finding static libraries

#LIBDIR=/usr/lib/x86_64-linux-gnu
LIBDIR=/usr/lib

But still don't work.
Do you have any ideas for fixing it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions