Wireshark source code compilation in Windows)

Source: Internet
Author: User
Tags tortoisesvn

Iwireshark windows compiling environment construction
1. Install cygwin
I have already put the ISO file in the shared file. The link is as follows:
\ 172.24.154.28 \ Software \ private tools \ networking tools \ cygwin-release-20061108.iso
2. Install Python (2.4.4 or 2.5.2)
Two versions of Python are provided here. The source code of Wireshark is Python 2.4.x by default. To use the latest version of Wireshark, You need to modify the config. nmake file by yourself. The Python link is as follows:
\ 172.24.154.28 \ Software \ private tools \ networking tools \ python-2.4.4.msi
\ 172.24.154.28 \ Software \ private tools \ networking tools \ python-2.5.2.msi
3. Install tortoisesvn (optional)
This is a version control tool used for checkout code from the wireshark server. This step is not required. You can download offline code compilation to achieve the same effect. Tortoisesvn links are as follows:
\ 172.24.154.28 \ Software \ private tools \ networking tools \ TortoiseSVN-1.5.3.13783-win32-svn-1.5.2.msi
4. Set the environment variables, including adding the environment variables of cygwin and the environment variables of Python.
5. Check the source code or decompress the source code.
I downloaded an offline source code package. The link is as follows:
\ 172.24.154.28 \ Software \ private tools \ networking tools \ wireshark-1.0.3.tar.gz
The library files required for compilation are originally downloaded through wget connection to the server, but the company's network needs to set a proxy to connect to the Internet, and wget is a command line operation, setting proxy is troublesome. I downloaded an offline library file. The link is as follows:
\ 172.24.154.28 \ Software \ private tools \ networking tools \ wireshark-win32-libs.rar
6. Check and modify the configuration file config. nmake. The extra version and Python path are modified to make version 2.5 available. if the version is version 2.4, no modification is required. The modified content mainly includes the following items:

 

# Extra version, customize your own development version, I modified the version is "fetag-1001"
Version_extra = "-fetag-1001"

# Path for storing the library files required during compilation
Wireshark_libs = D: \ wireshark-$ (Platform)-libs

# Specify the compiler type. You only need to select a Windows compiler on your machine. Other compilers # comment out all the options. My compiler is. net2008.
Msvc_variant = msvc2008

# Specify the installation path of cygwin executable program
Cygwin_path = c: \ cygwin \ bin

# Specify the installation path of the python executable program
Python = "D:/python25/python.exe"
7. Run c: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ bin> vcvars32.bat and set the 2008 compiling environment.
C: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ bin> vcvars32.bat

C: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ bin> "C: \ Program Files \ Microsoft
Visual Studio 9.0 \ common7 \ tools \ vsvars32.bat"
Setting environment for using Microsoft Visual Studio 2008x86 tools.
8. Verify compilation tool installation:
D: \ Wireshark> nmake-F makefile. nmake verify_tools

Microsoft (r) program maintenance utility 9.00.21022.08
Copyright (c) Microsoft Corporation. All rights reserved.

Checking for required applications:
CL:/cygdrive/C/program files/Microsoft Visual Studio 9.0/VC/bin/Cl
Link:/cygdrive/C/program files/Microsoft Visual Studio 9.0/VC/bin/Link

Nmake:/cygdrive/C/program files/Microsoft Visual Studio 9.0/VC/bin/nmak
E
Bash:/usr/bin/bash
Bison:/usr/bin/Bison
Flex:/usr/bin/flex
Env:/usr/bin/env
Grep:/usr/bin/grep
/Usr/bin/find:/usr/bin/find
Perl:/usr/bin/perl
D:/python25/python.exe:/cygdrive/D/python25/python.exe
Sed:/usr/bin/SED
Unzip:/usr/bin/unzip
Wget:/usr/bin/wget

D: \ Wireshark>
9. Install the library files required during compilation. Set the storage path of the library files in the config. nmake file:
D: \ Wireshark> nmake-F makefile. nmake setup
Wireshark is ready to build.
10, start to compile, note: packet-sndcp-xid.c and packet-ieee80211.c need to be re-converted to code as UTF-8
Format, otherwise there is a problem with compilation. This is a problem with the wireshark source code package. I have submitted a bug report. I hope the next version can solve this problem. (the source code version provided now is the latest download. I don't know if this problem exists ):
D: \ Wireshark> nmake-F makefile. nmake all
11. After compilation, run the program:
D: \ Wireshark> wireshark-gtk2 \ wireshark.exe

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.