| Libpcap problem !!! Urgent hi .. im having trouble writing a simple snippet using pcap.h
even when i try to compile a simple code like :
#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);
}
.. i get an error saying undefined reference to "pcap_lookupdev".
Even if i try a longer code .. i get the same error for each of the pcaps functionalities i have used (pcap_open_live, pcap_loop, etc).
I downloaded the pcap folder from tcpdump.org and pasted it in my usr/include. All include files are in order as far as i know.
I have 2 days left to my project deadline .. someone please help .. thanks alot .. cheers |