This wiki has been migrated to and is now deprecated. Please use that site instead.

Building Wireshark using Microsoft VC 7 and above

The info on this page is experimental. The main line to compile Wireshark under Windows is still using Microsoft Visual C++ Version 6, see the Developer's Guide for details.

This page describes how Wireshark can be compiled with recent Microsoft compilers (Version 7 and higher):

For the different Studios, see: ([])

One of the reasons for this is that the myriad of [ Win32 support lib] port projects all seem to believe there are legal issues involved in using newer versions of Visual Studio. This FUD essentially stems from two misconceptions:

  1. Unfortunately, it is believed by many that the Microsoft Visual Studio 2003 EULA explicitly forbids linking with GPL'ed programs. This belief is probably due to an improper interpretation of the [ Visual Studio 2003 Toolkit EULA], which places redistribution restrictions only on SOURCE CODE SAMPLES which accompany the toolkit.

  2. Other maintainers believe that the GPL itself forbids using Visual Studio 2003, since one of the required support libraries (MSVCR71.DLL) does not ship with the Windows operating system. This is also a wrongful interpretation, and the [ GPL FAQ] explicitly addresses this issue.

So due to this, the build process under newer versions of the Microsoft build environment does not work "out of the box". However, with a little work it is not only possible to build Wireshark under Visual Studio 2003, but also under the combination of the freely available [ .NET Framework SDK] and the [ Platform SDK].



If you intend to build from the free SDK components as opposed to Visual Studio 7, you will need to call the two path/environment scripts for the .NET SDK and the Plaform SDK. One way to do this is to edit your cygwin.bat startup script and add:

"C:\Program Files\Microsoft SDK\!SetEnv.Bat"
"C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\sdkvars.bat"

Or, if you are just using VS7, add :

"c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat"

to cygwin.bat. Make sure all SDK/Toolkit paths precede your cygwin paths. In particular, which link from within cygwin should give you the SDK version.

At this point you can run Anchor(setup)nmake -f Makefile.nmake setup from within the wireshark src dir.


At this point you should cleanup things first (removing UNIX related config.h and alike) by running:

nmake -f Makefile.nmake distclean

Then you can start building with:

nmake -f Makefile.nmake all


The ideal way to build is to create an installer. Add the following to packaging/nsis/wireshark.nsi:

File "c:\program files\Microsoft Visual Studio .NET 2003\Common7\IDE\msvcr71.dll"

Then run nmake -f Makefile.nmake packaging

This will build an wireshark-setup executable that will install all the libs you need to run it.


Can someone knowledgeable add a section about how to compile a dissector ? Manfred Nelles

Should we split this page into separate pages for building with MSVC7 and the free tools?

Should someone attempt to create a step-by-step guide for compiling, or is that doomed to fail due to differences in system setup? Erik Sternerson

The cygwin tools are described in the developers guide, so it might be a better way to link to the developer's guide (and probably update it) and link from here instead of duplicating information in the wiki. The developer's guide was an attempt to provide detailed information about setting up a build environment. I don't know if another step-by-step guide is a good idea. - UlfLamping

Some Notes on my experience using this page

My setup: Cygwin + all free tools.

Comments on the Setup section

I could not find C:\Program File\Microsoft SDK\SetEnv.Bat.

I did find C:\Program File\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd which seems to do the same thing. I just added the following to /cygwin.bat:

call "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd"
call "C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\sdkvars.bat"

Seemed easier than trying to edit the files provided by Microsoft.

By default Cygwin seems to put the MS PATH values at the end of the cygwin PATH variable. To make sure all SDK/Toolkit paths preceded my cygwin paths I just added the following to my .bash_profile. Saving the ORIGPATH is optional.

# Move MS compiler stuff to the front for Wireshark
MSPATH="`echo $PATH | tr : '\n' | grep Microsoft | tr '\n' :`"
UPATH="`echo $PATH | tr : '\n' | grep -v Microsoft | tr '\n' :`"
PATH="`echo $MSPATH:$UPATH | sed -e s/::\*/:/ -e s/^:// -e s/:\$//`"

Currently I can build Wireshark, but it blows up while initializing dissectors. I'll add the solution to that when I find it... - AndrewFeren