<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>How do I use this library, Im using the code::blocks ide and have included the library in the linker and and addded a include for pcap.h but now its telling me there are errors finding the rest of the include files.<br><br>Im very new to c programming.<br><br><br>::code::<br><br>#include <stdio.h><br>#include <stdlib.h><br>#include "pcap.h"<br><br>int main()<br>{<br> pcap_if_t *alldevs;<br> pcap_if_t *d;<br> int i=0;<br> char errbuf[PCAP_ERRBUF_SIZE];<br><br> /* Retrieve the device list from the local machine */<br> if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1)<br>
{<br> fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);<br> exit(1);<br> }<br><br> /* Print the list */<br> for(d= alldevs; d != NULL; d= d->next)<br> {<br> printf("%d. %s", ++i, d->name);<br> if (d->description)<br> printf(" (%s)\n", d->description);<br> else<br> printf(" (No description available)\n");<br> }<br><br> if (i == 0)<br> {<br> printf("\nNo interfaces found! Make sure WinPcap is
installed.\n");<br> return 1;<br> }<br><br> /* We don't need any more the device list. Free it */<br> pcap_freealldevs(alldevs);<br><br> return 0;<br>}<br><br><br>::errors::<br>C:\cdev\winpcaptests\pcap.h|41|pcap-stdinc.h: No such file or directory|<br>C:\cdev\winpcaptests\pcap.h|51|pcap-bpf.h: No such file or directory|<br>C:\cdev\winpcaptests\pcap.h|84|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|84|warning: type defaults to `int' in declaration of `bpf_u_int32'|<br>C:\cdev\winpcaptests\pcap.h|84|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|127|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|127|warning: no semicolon at end of struct or union|<br>C:\cdev\winpcaptests\pcap.h|128|warning: type defaults to `int' in declaration of
`version_major'|<br>C:\cdev\winpcaptests\pcap.h|128|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|129|error: syntax error before "version_minor"|<br>C:\cdev\winpcaptests\pcap.h|129|warning: type defaults to `int' in declaration of `version_minor'|<br>C:\cdev\winpcaptests\pcap.h|129|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|131|error: syntax error before "sigfigs"|<br>C:\cdev\winpcaptests\pcap.h|131|warning: type defaults to `int' in declaration of `sigfigs'|<br>C:\cdev\winpcaptests\pcap.h|131|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|132|error: syntax error before "snaplen"|<br>C:\cdev\winpcaptests\pcap.h|132|warning: type defaults to `int' in declaration of `snaplen'|<br>C:\cdev\winpcaptests\pcap.h|132|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|133|error: syntax error before
"linktype"|<br>C:\cdev\winpcaptests\pcap.h|133|warning: type defaults to `int' in declaration of `linktype'|<br>C:\cdev\winpcaptests\pcap.h|133|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|155|error: field `ts' has incomplete type|<br>C:\cdev\winpcaptests\pcap.h|156|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|156|warning: no semicolon at end of struct or union|<br>C:\cdev\winpcaptests\pcap.h|157|warning: type defaults to `int' in declaration of `len'|<br>C:\cdev\winpcaptests\pcap.h|157|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|164|error: syntax error before "u_int"|<br>C:\cdev\winpcaptests\pcap.h|164|warning: no semicolon at end of struct or union|<br>C:\cdev\winpcaptests\pcap.h|165|warning: type defaults to `int' in declaration of `ps_drop'|<br>C:\cdev\winpcaptests\pcap.h|165|warning: data definition has no type or storage
class|<br>C:\cdev\winpcaptests\pcap.h|166|error: syntax error before "ps_ifdrop"|<br>C:\cdev\winpcaptests\pcap.h|166|warning: type defaults to `int' in declaration of `ps_ifdrop'|<br>C:\cdev\winpcaptests\pcap.h|166|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|215|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|215|warning: no semicolon at end of struct or union|<br>C:\cdev\winpcaptests\pcap.h|231|error: syntax error before '*' token|<br>C:\cdev\winpcaptests\pcap.h|235|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|241|error: syntax error before "u_char"|<br>C:\cdev\winpcaptests\pcap.h|242|error: syntax error before "u_char"|<br>C:\cdev\winpcaptests\pcap.h|243|error: syntax error before '*' token|<br>C:\cdev\winpcaptests\pcap.h|244|warning: type defaults to `int' in declaration of `pcap_next'|<br>C:\cdev\winpcaptests\pcap.h|244|warning: data definition has no type
or storage class|<br>C:\cdev\winpcaptests\pcap.h|245|warning: type defaults to `int' in declaration of `u_char'|<br>C:\cdev\winpcaptests\pcap.h|245|error: syntax error before '*' token|<br>C:\cdev\winpcaptests\pcap.h|248|warning: "struct bpf_program" declared inside parameter list|<br>C:\cdev\winpcaptests\pcap.h|248|warning: its scope is only this definition or declaration, which is probably not what you want|<br>C:\cdev\winpcaptests\pcap.h|254|warning: type defaults to `int' in declaration of `u_char'|<br>C:\cdev\winpcaptests\pcap.h|254|error: syntax error before '*' token|<br>C:\cdev\winpcaptests\pcap.h|258|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|260|error: syntax error before "bpf_u_int32"|<br>C:\cdev\winpcaptests\pcap.h|261|warning: "struct bpf_program" declared inside parameter list|<br>C:\cdev\winpcaptests\pcap.h|283|error: syntax error before '*' token|<br>C:\cdev\winpcaptests\pcap.h|291|error: syntax error before
"bpf_filter"|<br>C:\cdev\winpcaptests\pcap.h|291|error: syntax error before "u_char"|<br>C:\cdev\winpcaptests\pcap.h|291|warning: type defaults to `int' in declaration of `bpf_filter'|<br>C:\cdev\winpcaptests\pcap.h|291|warning: data definition has no type or storage class|<br>C:\cdev\winpcaptests\pcap.h|292|warning: "struct bpf_insn" declared inside parameter list|<br>C:\cdev\winpcaptests\pcap.h|293|warning: "struct bpf_insn" declared inside parameter list|<br>C:\cdev\winpcaptests\pcap.h|294|warning: "struct bpf_program" declared inside parameter list|<br>C:\cdev\winpcaptests\main.c||In function `main':|<br>C:\cdev\winpcaptests\main.c|13|warning: implicit declaration of function `pcap_findalldevs_ex'|<br>C:\cdev\winpcaptests\main.c|13|error: `PCAP_SRC_IF_STRING' undeclared (first use in this function)|<br>C:\cdev\winpcaptests\main.c|13|error: (Each undeclared identifier is reported only once|<br>C:\cdev\winpcaptests\main.c|13|error: for each function
it appears in.)|<br>C:\cdev\winpcaptests\main.c|20|error: dereferencing pointer to incomplete type|<br>C:\cdev\winpcaptests\main.c|22|error: dereferencing pointer to incomplete type|<br>C:\cdev\winpcaptests\main.c|23|error: dereferencing pointer to incomplete type|<br>C:\cdev\winpcaptests\main.c|24|error: dereferencing pointer to incomplete type|<br>||=== Build finished: 32 errors, 35 warnings ===|<br><br></div></div><br>
</body></html>