2.2. Win32/64: Step-by-Step Guide

A quick setup guide for Win32 and Win64 with recommended configuration.


Unless you know exactly what you are doing, you should strictly follow the recommendations below. They are known to work and if the build breaks, please re-read this guide carefully.

Known traps are:

  1. Not using the correct (x86 or x64) version of the Visual Studio command prompt.
  2. Not copying/downloading the correct version of vcredist_xYY.exe.

2.2.1. Install PowerShell

PowerShell 2.0 or later is required for building Wireshark and the NSIS package. Windows 7 and later include compatible versions. It is also required by Chocolatey.

If you are running Windows Vista and have thus far managed to not install PowerShell 2.0, either directly or via anything that requires it, you must now install PowerShell 2.0. You can download it from https://www.microsoft.com/powershell

2.2.2. Optional: Install Chocolatey

Chocolatey is a native package manager for Windows. There are packages for most of the software listed below. Along with traditional Windows packages it supports Cygwin and the Python Package Index.

2.2.3. Install Microsoft C compiler and SDK

You need to install, in exactly this order:

  1. C compiler: Download and install "Microsoft Visual Studio 2013 Community Edition." This is a small download that then downloads all the other required parts (which are quite large).

Uncheck all the optional components (unless you want to use them for purposes other than Wireshark).

You can use Chocolatey to install Visual Studio:

PS$>choco install VisualStudioCommunity2013

You can use other Microsoft C compiler variants, but VS2013 is used to build the development releases and is the preferred option. It’s possible to compile Wireshark with a wide range of Microsoft C compiler variants. For details see Section 4.6, “Microsoft compiler toolchain (Windows native)”.

You may have to do this as Administrator.

Compiling with gcc or Clang is not recommended and will certainly not work (at least not without a lot of advanced tweaking). For further details on this topic, see Section 4.5, “GNU compiler toolchain (UNIX only)”. This may change in future as releases of Visual Studio add more cross-platform support.

Why is this recommended? While this is a huge download, Visual Studio 2013 Community Edition is the only free (as in beer) versions that includes the Visual Studio integrated debugger. Visual Studio 2013 is also used to create official Wireshark builds, so it will likely have fewer development-related problems.

For VS2010 You will need some extra items:

  1. Windows SDK for Windows 7, if you want to build 64-bit binaries for Windows 7: Download and install "Microsoft Windows SDK for Windows 7."

    In case the install of the SDK fails go to software management and remove the VC++ 2010 runtime and redist packages (don’t worry, they will be added back via the service pack later). If installation of the SDK still fails, there may be a permission problem. See here for a solution.

  2. C compiler service pack: Download and install "Microsoft Visual Studio 2010 Service Pack 1." This is a very large download.
  3. Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1, if you want to build 64-bit binaries for Windows 7: Download and install "Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1."
  4. If you will be building 64-bit binaries those items must be installed in that order as installing the Microsoft Visual Studio 2010 Service Pack 1 can, if you’ve installed the Microsoft Windows SDK for Windows 7, remove the 64-bit compilers, as per http://support.microsoft.com/?kbid=2519277 the Microsoft Knowledge Base article "FIX: Visual C++ compilers are removed when you upgrade Visual Studio 2010 Professional or Visual Studio 2010 Express to Visual Studio 2010 SP1 if Windows SDK v7.1 is installed". The release notes for the Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 say that, to ensure that your system has a supported configuration, you must install the items in the order specified above. If you have Microsoft Update installed, so that the Windows update process will update software other than components of Windows, and thus will update Visual Studio, you may need to disable it until after all of the above are installed, to make sure it doesn’t install Visual Studio 2010 SP1 out of order.

2.2.4. Install Qt

The main Wireshark application uses the Qt windowing toolkit. To install Qt download the Online Installer from the Qt Project download page and select a component that matches your target system and compiler. For example, the “msvc2013 64-bit OpenGL” component is used to build the official 64-bit packages.

Note that separate installations (into different directories) of Qt are required for 32 bit and 64 bit builds. The environment variable QT5_BASE_DIR should be set as appropriate for your environment and should point to the Qt directory that contains the bin directory, e.g. C:\Qt\Qt5.5.0\5.5\msvc2013

2.2.5. Install Cygwin

On 32-bit Windows, download the 32-bit Cygwin installer and start it. On 64-bit Windows, download the 64-bit Cygwin installer and start it.

At the "Select Packages" page, you’ll need to select some additional packages which are not installed by default. Navigate to the required Category/Package row and, if the package has a "Skip" item in the "New" column, click on the "Skip" item so it shows a version number for:

  • Archive/unzip (not needed if using CMake)
  • Devel/bison (or install Win flex-bison - see Chocolatey below)
  • Devel/flex (or install Win flex-bison - see Chocolatey below)
  • Devel/git (recommended - see discussion about using Git below)
  • Interpreters/perl
  • Utils/patch (only if needed) (may be Devel/patch instead)
  • Web/wget (not needed if using CMake)
  • Text/asciidoc
  • Text/docbook-xml45

You might also have to install

  • Interpreters/m4

if installing Devel/bison doesn’t provide a working version of Bison. If m4 is missing bison will fail.

After clicking the Next button several times, the setup will then download and install the selected packages (this may take a while).

Why is this recommended? Cygwin’s bash version is required, as no native Win32 version is available. As additional packages can easily be added, Perl and other packages are also used.

Alternatively you can install Cygwin and its packages using Chocolatey:

PS$>choco install cygwin
PS$>choco install cyg-get
PS$>choco install sed asciidoc [...] -source cygwin

Chocolatey installs Cygwin in C:\tools\cygwin by default.

You can use Chocolatey’s Win flex-bison packages rather than the Cygwin Bison and Flex package:

PS$>choco install winflexbison

2.2.6. Install Python

Get the Python 2.7 installer from http://python.org/download/ and install Python into the default location (C:\Python27).

Why is this recommended? Cygwin’s Python package doesn’t work on some machines, so the Win32 native package is recommended (and it’s faster). Note that Python 3.x isn’t currently supported.

Alternatively you can install Python using Chocolatey:

PS$>choco install python2

Chocolatey installs Python 2 in C:\tools\python2 by default.

2.2.7. Install Git

Please note that the following is not required to build Wireshark but can be quite helpful when working with the sources.

Working with the Git source repositories is highly recommended, see Section 3.3, “Obtain the Wireshark sources”. It is much easier to update a personal source tree (local repository) with Git rather than downloading a zip file and merging new sources into a personal source tree by hand. It also makes first-time setup easy and enables the Wireshark build process to determine your current source code revision.

There are several ways in which Git can be installed. Most packages are available at the URLs below or via Chocolatey. Note that many of the GUI interfaces depend on the command line version. The Official Windows Installer

The official command-line installer is available at http://msysgit.github.io/. Git Extensions

Git Extensions is a native Windows graphical Git client for Windows. You can download the installer from http://code.google.com/p/gitextensions/. TortoiseGit

TortoiseGit is a native Windows graphical Git similar to TortoiseSVN. You can download the installer from http://code.google.com/p/tortoisegit/. Command Line client via Chocolatey

The command line client can be installed (and updated) using Chocolatey:

PS$> choco install git Others

A list of other GUI interfaces for Git can be found at http://git-scm.com/downloads/guis