|
pcap error
Hi,
I'm trying to execute the following code
#include <stdio.h>
#include <pcap.h>
int main(int argc, char *argv[])
{
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev = pcap_lookupdev(errbuf);
if (dev == NULL) {
fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
return(2);
}
printf("Device: %s\n", dev);
return(0);
}
but it is giving me the following error however I've install libpcap
/root/Projects/test/src/main.c:11: undefined reference to 'pcap_lookupdev'
I can't understand the problem.
regards,
Imran
thanks
|