[Winpcap-bugs] "vsnprintf" - build error in winpcap ver. 4.0.2 built with MS Visual Studio C++

James Rhodes james_rhodes at ciqual.com
Wed Feb 4 13:54:46 GMT 2009


Hi there,

Most likely you have encountered this, but I couldn't find a reference 
so I'll submit a bug.

1) I downloaded the winpcap development kit for 4.0.2

2) Loaded the examples into the the latest version of MS Visual Studio 
C++ Express

3) Build gives error:
--------------------------------------------------
    Compiling...
basic_dump.c
c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(358) : 
error C3163: '_vsnprintf': attributes inconsistent with previous declaration
         c:\program files\microsoft visual studio 
9.0\vc\include\stdio.h(350) : see declaration of '_vsnprintf'
---------------------------------------------------

4) A confilct exists in pcap-stdinc.h line 63 ("#define vsnprintf 
_vsnprintf")

5) A (temporary) fix is to comment out that line.

6) A little dig around (with the aid of google) shows that MS has (in it 
s latest release) decided to add it's own definition of 
vsnprintf...which means that the supplied definition is not compatible 
with that ver. of the MS tool.

7) Full fix conditional guard around define depending on whether the 
symbol is already defined ???

8) Problem would seem to exist in ver. 4.1.beta5 as well

Cheers,
    James.



More information about the Winpcap-bugs mailing list