This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

can’t compile wireshark

0

I got an error while compiling wireshark.

erf.c erf.c(654) : error C2220: warning treated as error - no 'object' file generated erf.c(654) : warning C4244: '=' : conversion from 'gint64' to 'int', possible lo ss of data mp2t.c mp2t.c(121) : error C2220: warning treated as error - no 'object' file generated

mp2t.c(121) : warning C4244: '=' : conversion from 'guint64' to 'int', possible loss of data Generating Code... NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Platform SDK\Bin\nmake.e xe"' : return code '0x2' Stop.

i find many post on internet and forum i found that it can be avoided by doing

In the top-level Wireshark directory config.h:

Comment out the following if warnings are not to be treated as errors

WARNINGS_ARE_ERRORS=-WX

but in config.h i didn't find this tag.

Wireshark version - 1.8.3 OS - Windows 7 Visual studio 2005.

i followed http://www.codeproject.com/Articles/19426/Creating-Your-Own-Custom-Wireshark-Dissector link to build the code.

asked 06 Nov '12, 22:10

ishan's gravatar image

ishan
1223
accept rate: 0%

WARNINGS_ARE_ERRORS is in config.nmake (for Windows builds). In the release versions (e.g., 1.8.3) then it should already be commented out. So I'm not sure why you're getting "warning treated as error"...

(07 Nov '12, 10:12) JeffMorriss ♦

One Answer:

1

The instructions in the link you provided are based on a very old toolchain (VS2005) but look like they should work. I'm not aware of that many people building with VS2005 these days, and you may have more success with a more up to date toolchain, e.g. VS2010 Express.

The definitive guide to building Wireshark is the Wireshark Developers Guide that is kept current by Wireshark Core Developers. You must follow each step in the Guide to the letter, omitting or varying any steps is likely to lead to build failures.

Finally, have you made any modifications to the source files before attempting the build (apart from config.nmake)? If so, please try to complete a build with unmodified source files first just to prove your build environment.

answered 07 Nov '12, 00:19

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks grahamb ,

i followed the steps there and i was able to install and build Wireshark.

Two observation which i want to mention which will help users.

  1. Their might be issues during installation of Visual studio 2010 , while installing silverlight it might rollback the installation. To avoid that , uninstall the all silverlight version from Add nad remove programs in control pannel and if their are issues during uninstall process of silverlight then go to http://support.microsoft.com/mats/Program_Install_and_Uninstall/ and fix the problem by running it.
  2. It is usual that during installation of visual studio 2010 , after downloading all packages , the setup itself rollback. So don't worry , it is installed on your system and move to next step in installation guide.
(07 Nov '12, 22:19) ishan