conflict with pcap.h and bfp.h

Ben Greear yellowdog-general@lists.terrasoftsolutions.com
Mon Aug 4 16:36:01 2003


While trying to compile my software on YDL 3.0, I get this conflict:

g++       -g -static -O2  -D_GNU_SOURCE -D_BG_TEMPLATE_HACK  -Wall -I/home/greear/btbits/btbits/include -I/home/greear/btbits/btbits/l4libs/curl-7.10.4/include -DPPC -c lf2pcap.cc
In file included from lf2pcap.cc:21:
/usr/include/net/bpf.h:369: previous declaration of `u_int
    bpf_filter(bpf_insn*, u_char*, unsigned int, unsigned int)' with C++ linkage
/usr/include/pcap.h:169: conflicts with new declaration with C linkage
/usr/include/net/bpf.h:368: previous declaration of `int
    bpf_validate(bpf_insn*, int)' with C++ linkage
/usr/include/pcap.h:170: conflicts with new declaration with C linkage
make: *** [lf2pcap.o] Error 1


I commented out this code from /usr/include/pcap.h and it compiles fine.
Btw, this same code compiles fine on RH 9, but it could still be a problem
in my code...

/usr/include/pcap.h:

/* XXX this guy lives in the bpf tree */
u_int   bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
int     bpf_validate(struct bpf_insn *f, int len);
char    *bpf_image(struct bpf_insn *, int);
void    bpf_dump(struct bpf_program *, int);


Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com