Hello people,
 I've found a strange thing, while pocking around with libcap library.
ftp://ftp.ee.lbl.gov/libpcap.tar.Z The thing is I don't quite understand
how includes are woring there. Here're the things:

1. I have compiled and installed the whole library (configure/make/make
install). 
2. copied manually two includes, which I think, should be used by any
program which supposes to use the library:

pcap.h
net/bpf.h from the library source into /usr/include three (so new I could
use'em within <..> brackets).

Now the curious thing:

when I define a variable of type pcap_t, like:

#include <pcap.h>

void main() {
pcap_t foo;
}
I get 'referencing to incomplete type' error.

I checked pcap.h file, which has it defined as

typedef struct pcap pcap_t;
and pcap is not defined anywhere in this file nor files it includes. Doing
some search I found that the structure is defined in pcap-int.h file, so I
copied it as well to /usr/include, and added an 
#include <pcap-int.h> before #include <pcap.h>. Everything works.
However, whenever I compile original code with

-I/path/to/libcapsource/libcap-0.4  flag, I do not get such error. Why?
does it include that definition on some default basis or something? are
there any includes which could be included "by default"? the curious fact
is that when I used

#include "/path/to/libcap/libcap-0.4/pcap.h"
in original piece, it compiles fine even without -I switch. (and I am
copying exactly the same files).

 Any ideas what may've caused this?





--
[EMAIL PROTECTED]           http://www.kalug.lug.net

Reply via email to