[Winpcap-users] including pcap.h fails build

Andrej van der Zee andrejvanderzee at gmail.com
Tue Jul 28 02:09:19 PDT 2009


Hi,

I am trying to port my C++ Linux application that uses very basic
features of libpcap. I am trying to compile this on Windows, but I
keep getting into weird trouble that is maybe caused by my lack of
understanding of Windows. But it only happen when I include "pcap.h"
and define WIN32. Anyway, these are the errors:

main.cpp
main.cpp(215) : error C2332: 'struct' : missing tag name
main.cpp(215) : error C2039: '<unnamed-tag>' : is not a member of 'net_buckets'
        c:\cygwin\home\andrej\mbrace\trunk\parsers\cap2net\../core/net_bucket.h(93)
: see declaration of 'net_buckets'
main.cpp(215) : error C2274: 'function-style cast' : illegal as right
side of '.' operator
main.cpp(240) : error C2332: 'struct' : missing tag name
main.cpp(240) : error C2039: '<unnamed-tag>' : is not a member of 'net_buckets'
        c:\cygwin\home\andrej\mbrace\trunk\parsers\cap2net\../core/net_bucket.h(93)
: see declaration of 'net_buckets'
main.cpp(240) : error C2274: 'function-style cast' : illegal as right
side of '.' operator
main.cpp(246) : error C2332: 'struct' : missing tag name
main.cpp(246) : error C2039: '<unnamed-tag>' : is not a member of 'net_buckets'
        c:\cygwin\home\andrej\mbrace\trunk\parsers\cap2net\../core/net_bucket.h(93)
: see declaration of 'net_buckets'
main.cpp(246) : error C2274: 'function-style cast' : illegal as right
side of '.' operator
main.cpp(256) : error C2332: 'struct' : missing tag name
main.cpp(256) : error C2039: '<unnamed-tag>' : is not a member of 'net_buckets'
        c:\cygwin\home\andrej\mbrace\trunk\parsers\cap2net\../core/net_bucket.h(93)
: see declaration of 'net_buckets'
main.cpp(256) : error C2274: 'function-style cast' : illegal as right
side of '.' operator

Removing the #include for "pcap.h" makes this issue go away. I
searched the error number but it seems not to be applicable to my
case.

I was hoping somebody could help me.

Best regards,
Andrej


More information about the Winpcap-users mailing list