Step by step to compile wireshark 1.10.10


1. Wireshark 1.10.10 source code download
The source code can be downloaded from http://www.wireshark.org/download page, and can be downloaded by SVN tools, such as TortoiseSVN, from repository http://anonsvn.wireshark.org/wireshark/trunk
You can download the latest version instead, but the latest version requires Qt, means you need download an extra tool: Qt 5.3.2.

Qt 5.3.2: http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-windows-x86-msvc2010_opengl-5.3.2.exe

As you know, Wireshark is a great tool for protocol analysis, you should research into its source code if you are intresting in networking programming.

2. Preparations and prerequirements
I’m here only introducing some brief/key steps to build a specified version of Wireshark. More and details about compiling Wireshark on Windows you can refer to http://www.wireshark.org/docs/wsdg_html_chunked.

1) Install Microsoft Visual C++ 2010
2) Install Microsoft Windows SDK 7.1
Download url: http://www.microsoft.com/en-us/download/confirmation.aspx?id=8279, over there you can choose download an ISO image GRMSDKX_EN_DVD.iso instead of a web install program.
3) Install Microsoft Visual Studio 2010 Service Pack 1
Dowload URL: http://www.microsoft.com/en-us/download/details.aspx?id=23691
4) Install Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 (VC-Compiler-KB2519277.exe)
Download URL: http://www.microsoft.com/en-US/download/details.aspx?id=4422

5) Install Cygwin
Download Address: http://www.cygwin.com/setup.exe
Run the setup.exe, and you can choose to download the installer package or install on-line directly. During the installation, a dialog will show you all the available tools for installation. There are some tools required for building Wireshark source code successfully.
Tools Needed to Select
Archive/unzip
Devel/bison
Devel/flex
Interpreters/perl
Utils/patch
Web/wget

6) Install Python
As what suggested in Wireshark WIKI site, we should choose Python 2.7.x, which can be downloaded here: http://python.org/download

7) Install Subversion Client(Optional)
Subversion Client is used for version control, you can download it from http://subversion.apache.org. http://subversion.apache.org/packages.html#windows
There are lots of releases for Windows, anyone of them would be fine. Except the list there, you can choose TortoiseSVN instead, it’s also have svn command line program packed in its installation.

8) Install TortoiseSVN (Optional)

3. Start to compile

1) Prepare source code
Use your installed SVN client tool, or git, to checkout the source code. I’m using path D:\svn\netmedia\20-protocol\wireshark\wireshark_src\wireshark-1.10.10 to save my source code.

2) Modify and configure your config.nmake file
Extract the source code package to a directory, where there is a config.namke file. Modify the files as below (search the files with key words). Recommend to backup config.nmake file before any change.
—————————————-
Key Words          Value          Actions
WIRESHARK_LIBS  The location of your Wireshark library
MSVC_VARIANT      Your version of Microsoft Visual Studio C++
GTK1_DIR          $(WIRESHARK_LIBS)\gtk+    use # to comment this line out as if you plan to use the latest version GTK 2
GTK2_DIR          $(WIRESHARK_LIBS)\gtk2    Default
CYGWIN_PATH        The path of Cygwin bin directory
PYTHON            The path of python    you can install standalone version of python, or use the default python in Cygwin\bin
MAKENSIS          The path of MakeNsis    use # to comment this line out if you haven’t installed MakeNsis
HHC_DIR            $(PROGRAM_FILES)/HTML Help Workshop/    use # to comment this line out if you haven’t installed Html Help Workshop
INSTALL1_DIR      wireshark-gtk1    use # to comment this line out if you don’t want to generate GTK 1 version’s Wireshark

—————————————-
Table 1. Configuration Change

A) MSVC_VARIANT=MSVC2010           # Remove the ‘#’ MSVC_VARIANT=MSVC2010
B) WIRESHARK_TARGET_PLATFORM=win32 # or win64

3) Ready? Launch !
Start a DOS command window(Run as Administrator)
A) Set Visual C++ 2010 environment variants:
If you are building on a 32-bit machine
To build 32-bit binaries call “C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat”
And to build 64-bit binaries call “C:\Program Files\Microsoft Visual Studio 10.0\VC\Vcvarsall.bat x86_amd64”
If you are building on a 64-bit machine,
To build 32-bit binaries call “C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat”
And to build 64-bit binaries call “C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\Vcvarsall.bat amd64”

4) Verify installed/required
A) Locate to your wireshark source directory:

B) Verify tools

There will be an error message like this if it’s the first time you trying to build wireshark
ERROR: The contents of ‘C:\Wireshark-win32-libs\current_tag.txt’ is (unknown).

It’s only because you haven’t download the required packages, yet. Ignore it, and after the next step, you’ll get all of them.

5) Install required libraries
Run command below to start the auto setup and download the required libraries.

The libraries will be downloaded and saved to C:\Wireshark-win32-libs.
In normal cases of bandwidth, this requires ETA 5 minutes.
After downloaded all the libraries, you can run “nmake -f Makefile.nmake verify_tools” once more, then you’ll find the error message in the previous step is no more exist.

6) Clean the sources
Run command below to clean the sources

This step is used to clean the obj files generated in a previous compilation, and make ready for the incoming next build.

7) Build Wireshark

Wait until the compilation is finished, once it’s done, you can try run the compiled wireshark.exe to verify whether or not the compilation is success.

d:/svn/netmedia/20-protocol/wireshark/wireshark_src/wireshark-1.10.10/wireshark-gtk2/wireshark.exe

Leave a comment

Your email address will not be published. Required fields are marked *