Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Problem with recommended Makefile.nmake

From: Ed Beroset <beroset@xxxxxxxxxxxxxx>
Date: Thu, 14 Jul 2011 14:00:41 -0400 (GMT-04:00)
eymanm wrote:
>While building a plugin on Windows with Wireshark 1.6.0, I'm trying to
>follow directions provided in README.plugins. With the recommended content
>of \plugins\myudp\Makefile.nmake (attachment Recommended_Makefile.nmake) I'm
>getting compilation errors as shown in attachment CompilationErrors.txt.
>However, if use a different Makefile.nmake
>(attachment Modified_Makefile.nmake), the compilation is successful.

>Can somebody help to figure out what's wrong with using the recommended
>Makefile.nmake?

The error messages say:
packet-myudp.c(90) : error C2220: warning treated as error - no 'object' file generated

packet-myudp.c(90) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify pre

cedence

packet-myudp.c(782) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'

packet-myudp.c(1119) : warning C4244: '=' : conversion from 'double' to 'gfloat', possible loss of data

packet-myudp.c(1219) : warning C4244: '=' : conversion from 'double' to 'gfloat', possible loss of data

packet-myudp.c(1860) : warning C4244: '=' : conversion from 'double' to 'gfloat', possible loss of data

packet-myudp.c(2134) : warning C4244: '=' : conversion from 'guint16' to 'guint8', possible loss of data

The difference in the makefiles is that you don't have the "warnings treated as error" turned on in the modified file, but that's not the correct modification to make.  The correct way to address this is to fix the warnings in packet-myudp.c as pointed out by the compiler.  They look like mostly minor things that would only need a few minutes to address and your code will be better quality as a result even though it may work as intended already.

Ed