tcpdump mailing list archives

about packet capture


From: Tao Peng <taop () ee mu oz au>
Date: Tue, 3 Feb 2004 15:44:41 +1100 (EST)

Dear All,

I am a rookie to network programming, and I am having troubles of compling
a single code.

The code is as follows:
******************************************************
#include <stdio.h>
#include <pcap.h>
int main()
{
    char *dev, errbuf[PCAP_ERRBUF_SIZE];
    dev = pcap_lookupdev(errbuf);
    printf("Device: %s\n", dev);
    return(0);
}
******************************************************

when I complie it using gcc, it gives me an error as follows:
/var/tmp//cc95eETb.o: In function `main':
/var/tmp//cc95eETb.o(.text+0x1e): undefined reference to `pcap_lookupdev'

But I had my pcap.h included, and I don't know why. Can anyone help me
about this?

Thanks

-------------------------------
Tao Peng
CUBIN Research Centre,EEE Dept.
Melbourne Uni., Australia
Phone: + 61 3 8344 3822
Fax:   + 61 3 8344 3821
Mobile: 0402 947 026
-------------------------------


-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: