Winpcap compile error in pcap-stdinc.h in vc++ 6.0

When compiling winpcap in your program on Visual C++ 6.0 you might get an error like this :

Compiling...
main.cpp
c:\codes\include\pcap-stdinc.h(79) : error C2144: syntax error : missing ';' before type 'unsigned int'
c:\codes\include\pcap-stdinc.h(79) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

And it will point to the following lines in pcap-stdinc.h

typedef _W64 unsigned int   uintptr_t;
typedef _W64 int   intptr_t;

Simple edit them as :

typedef unsigned int   uintptr_t; //typedef _W64 unsigned int   uintptr_t;
typedef int   intptr_t; //typedef _W64 int   intptr_t;

Now it should compile fine.







Last Updated On : 9th February 2013

Subscribe to get updates delivered to your inbox

1 Comment + Add Comment

  • it’s not work…

    getting more error like below.
    —————————————————
    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(22) : error C2065: ‘ETHER_ADDR_LEN’ : undeclared identifier

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(22) : error C2057: expected constant expression

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(22) : warning C4200: nonstandard extension used : zero-sized array in struct/union

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(23) : error C2057: expected constant expression

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(23) : error C2229: struct ‘ether_header’ has an illegal zero-sized array

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(23) : warning C4200: nonstandard extension used : zero-sized array in struct/union

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(24) : error C2229: struct ‘ether_header’ has an illegal zero-sized array

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(73) : error C2065: ‘num’ : undeclared identifier

    c:program filesmicrosoft visual studiomyprojectspcappacket.cpp(200) : error C2143: syntax error : missing ‘)’ before ‘{‘

    ——————————–
    how can i fix it??? does anyone know? hlp me plz…

Leave a comment