tcpdump mailing list archives

problem with including pcap.h


From: Marc-André Breton <marc.andre.breton () lagrit etsmtl ca>
Date: Tue, 11 Mar 2003 11:25:31 -0500

Hi all,

I am a new pcap worker and I have some problems to include pcap.h in my c++ 
program. I am working on a Linux - Red Hat 7.3 machine with libpcap-0.6.2-12 
and my compiler is gcc-2.96-110. I had two problems:

Firts, when I want to include pcap.h, I had the following error:

#include <pcap.h>
main.cpp:24:18: pcap.h: No such file or directory

So I decide to write the entire path like:
#include </usr/include/pcap/pcap.h>  

Now I have the following error:
In file included from main.cpp:24:
/usr/include/pcap/pcap.h:42:21: net/bpf.h: No such file or directory

So I decided to copy the folder /usr/include/pcap in my project and errors for 
the include seems gone but now I have the following errors:

g++ -DHAVE_CONFIG_H -I. -I. -I.. -O2 -O0 -g3 -Wall -fno-exceptions 
-fno-check-new -c main.cpp 
In file included from main.cpp:24: 
net/bpf.h:369: previous declaration of `u_int bpf_filter (bpf_insn *, 
u_char *, unsigned int, unsigned int)' with C++ linkage 
pcap.h:169: conflicts with new declaration with C linkage 
net/bpf.h:368: previous declaration of `int bpf_validate (bpf_insn *, 
int)' with C++ linkage 
pcap.h:170: conflicts with new declaration with C linkage 
gmake: *** [main.o] Error 1 
*** failed ***

Is there someone who know what can I do for it??
Please help me

Sorry for my bad english! and thanks in advance for your help!

Marc-Andre


-
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: