I'm attempting to compile a .c file on a Sitara Am335x starter kit with sdk-linux-amr335-evm-02.00.01.07 and require libpcap.
I haven't had luck with installing the latest libpcap (incompatible lex and issues with flex/bison). However, I see that there is a libpcap.so in the /usr/lib directory supplied with the SDK rootfs. I went ahead and added the headers from the libpcap package to the /usr/include directory.
I have attempted to compile with gcc foo.c -o foo -lpcap and gcc -L/usr/lib -o foo foo.c -lpcap and get the same error:
"/user/lib/gcc/arm-Linux/gnueabi/4.9.3/../../../../arm-Linux-gnueabi/bin/ld: cannot find -lpcap
collect2: error: ld returned 1 exit status"
libpcap.so.1 and libpcap.so.1.6.2 are clearly located in /usr/lib so I don't understand why it can't find the file?
It has occurred to me that the error may be in the gcc target but I don't know how to change that or add the library to the target?
Also, I'm currently hosting the kernel and rootfs on an SD card as I need both eth0 and eth1 configured into a bridge. Consequently, I've been attempting to compile everything on the board itself. Is this something that has to be cross compiled and then moved to the SD card?