0
-desktop:~/Desktop$ gcc -lpcap test.c -o test
/tmp/cczDYeHY.o: In function `main':
test.c:(.text+0xbc): undefined reference to `pcap_lookupdev'
test.c:(.text+0x11b): undefined reference to `pcap_lookupnet'
test.c:(.text+0x143): undefined reference to `pcap_open_live'
test.c:(.text+0x1a9): undefined reference to `pcap_compile'
test.c:(.text+0x1ef): undefined reference to `pcap_setfilter'
test.c:(.text+0x23a): undefined reference to `pcap_loop'
collect2: error: ld returned 1 exit status
Tech
  • 1

1 Answers1

1

This question was already asked on Stack Overflow. You should move -lpcap to the end of your command. But even if you are using Ubuntu, this question is off topic here, it would better fit on Stack Overflow.