ev'ning everyone,

i got some obscure behaviour of gcc/icc over here,
is there anyone able to tell my why this happens/works?

> v4hn 18:52:19 ~/repos/netscan $ gcc -lpthread -lpcap *.o -o portscan
network.o: In function `default_device':
network.c:(.text+0x5d5): undefined reference to `pcap_lookupdev'
scan.o: In function `setupfilter':
scan.c:(.text+0x94d): undefined reference to `pcap_lookupnet'
scan.c:(.text+0xa04): undefined reference to `pcap_compile'
scan.c:(.text+0xa14): undefined reference to `pcap_geterr'
scan.c:(.text+0xa41): undefined reference to `pcap_setfilter'
scan.c:(.text+0xa51): undefined reference to `pcap_geterr'
scan.o: In function `generic_tcp_raw_scan':
scan.c:(.text+0xda4): undefined reference to `pcap_open_live'
scan.c:(.text+0xdd6): undefined reference to `pcap_get_selectable_fd'
scan.c:(.text+0x10be): undefined reference to `pcap_next_ex'
scan.c:(.text+0x1123): undefined reference to `pcap_geterr'
scan.c:(.text+0x1193): undefined reference to `pcap_close'
collect2: ld returned 1 exit status
> v4hn 18:52:31 ~/repos/netscan $ gcc -lpthread *.o -o portscan -lpcap
> v4hn 18:52:52 ~/repos/netscan $ ls portscan
portscan
> v4hn 18:53:03 ~/repos/netscan $ 

so I needed the following patch to compile it over here on my (lunar-)linux box.

--- makefile    2010-01-02 18:56:40.000000000 +0100
+++ makefile.patched       2010-01-02 18:58:08.000000000 +0100
@@ -13 +13 @@
-  $(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
+  $(CC) $(OBJS) -o $(PROG) $(LDFLAGS)



v4hn

Attachment: pgpvVHtygBnc8.pgp
Description: PGP signature

Reply via email to