Hi, I'm new to linux C programming and am in need of the libpcap
library.  I can't seem to get the thing to compile though.  Maybe you
could help.

Here's the source:

#include <pcap.h>
#include <stdio.h>


static pcap_t *ndp;

int main()
{
 char device[] = "/dev/eth0";
 char nerror[PCAP_ERRBUF_SIZE];
 #ifdef lib_pcap_h
 printf( "%d", PCAP_ERRBUF_SIZE );
 #endif

 //if(
 ndp = pcap_open_live( device, 1000, 1, 1000, nerror );
 // == NULL ) {
 // puts( nerror );
 //}
 return 0;
}

As you can see, it's nothing spectacular, I was just getting started.
Here's the error I get:

$ gcc -I/usr/include/pcap -lpcap -o porcupine porcupine.c
/tmp/ccUbVZOg.o: In function `main':
/tmp/ccUbVZOg.o(.text+0x51): undefined reference to `pcap_open_live'
collect2: ld returned 1 exit status
$

If you have any ideas for me, I'd really appreiciate it.  Thanks in
advance.
Jesse

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to