Wireshark-dev: Re: [Wireshark-dev] VS2008 Express compilation attempt
From: Kaul <[email protected]>
Date: Tue, 20 Nov 2007 21:57:09 +0200
The attached change to libpcap.c (re-order the #include statements) seems to solve it.
There are other places it is required (capture-wpcap.c, for example), and this simple change didn't work as nicely.

There's a similar problem with inet_pton() and inet_ntop() in various other files:
capture.c
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(583) : error C2
373: 'inet_pton' : redefinition; different type modifiers
        c:\wireshark\inet_v6defs.h(31) : see declaration of 'inet_pton'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(600) : error C2
373: 'inet_ntop' : redefinition; different type modifiers
        c:\wireshark\inet_v6defs.h(33) : see declaration of 'inet_ntop'
capture_opts.c
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(583) : error C2
373: 'inet_pton' : redefinition; different type modifiers
        c:\wireshark\inet_v6defs.h(31) : see declaration of 'inet_pton'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(600) : error C2
373: 'inet_ntop' : redefinition; different type modifiers
        c:\wireshark\inet_v6defs.h(33) : see declaration of 'inet_ntop'
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.EXE"' : return code '0x2'
Stop.


On Nov 20, 2007 9:24 PM, Kaul < [email protected]> wrote:
A naive attempt (see attached patch to Makefile.nmake), resulted in:

...
libpcap.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(358) : error C31
63: '_vsnprintf': attributes inconsistent with previous declaration
        C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(350) : s
ee declaration of '_vsnprintf'
...
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.EXE"' : return code '0x2'
Stop.


I found similar issue here: http://sourceforge.net/forum/forum.php?thread_id=1839725&forum_id=36109
but I couldn't resolve it in Wireshark's case.

Attachment: libpcap.c.diff
Description: Binary data