I had the same isue in this problem Pcap functions have "undefined reference" and this code line solved it.
gcc expl1.c -lpcap
But now I am trying to cross-compile the same file using this command
aarch64-linux-gnu-gcc -mcpu=cortex-a57 expl1.c -lpcap
but I got this error:
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: cannot find -lpcap
collect2: error: ld returned 1 exit status