Others' questions and answers:
The following error occurs when compiling Winpcap 4.1.1 In vc6 because vc6.0 does not fully support the C ++ 99 standard and may cause compilation problems in 64-bit CPU, switch Winpcap to version 4.0.1 and the following errors disappear
C: \ wpdpack \ include \ pcap-stdinc.h (79): Error c2144: syntax error: Missing '; 'before type' unsigned int'
C: \ wpdpack \ include \ pcap-stdinc.h (79): Fatal error c1004: unexpected end of file found
You can also use the method of upgrading vc6.0 psdk.
Solution:
Leo solution:
However, I am not bothered by either of the two methods (this is a variety of errors caused by various software versions such as Vs and so on ....)
Since the psdk version of vc6 is low, w64 is not supported. That's good! I used vs2008, so we can always follow up on the wincap of the later version. The result is correct.
Or press the original Handler --> put the folder wpdpack into the project directory, Set setting (include and Lib) in the option, right-click the project and choose Properties> Preprocessor with wpcap; have_remote, and-> linker-> input with wpcap. lib is configured.
The following is a simple example of Leo compilation. You can try it:
// Wincaptest2008.cpp: defines the entry point for the console application.
//
# Include "stdafx. H"
# Include "pcap. H" // Leo begins to define this sentence before # include "sdafx. H". The result is 22 errors, and the compilation is successful after the change.
Int _ tmain (INT argc, _ tchar * argv [])
{
Pcap_if_t * alldevs;
Pcap_if_t * D;
Int I = 0;
Char errbuf [pcap_errbuf_size];
If (pcap_findalldevs (& alldevs, errbuf) =-1)
{
Fprintf (stderr, "error in pcap_findalldevs_ex: % s \ n", errbuf );
Exit (1 );
}
For (D = alldevs; D! = NULL; D = D-> next)
{
Printf ("% d. % s", ++ I, d-> name );
If (D-> description)
Printf ("(% s) \ n", D-> description );
Else
Printf ("(no description available) \ n ");
}
If (I = 0)
{
Printf ("\ Nno interfaces found! Make sure Winpcap is installed. \ n ");
Return-1;
}
Pcap_freealldevs (alldevs );
Return 0;
}