-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
Asked
Active
Viewed 1,020 times
0
Dimitri Podborski
- 2,715
Tech
- 1
1 Answers
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.
Dimitri Podborski
- 2,715