Wireshark compilation environment settings and compilation

Source: Internet
Author: User
Tags subversion client vc runtime

Wireshark (recently called Ethereal) is a famous network protocol analysis tool that supports multiple protocol message parsing ...... (A few words are omitted here). The following is an official explanation: "Wireshark is the world's foremost network protocol analyzer, and is the de facto (and often de jure) "Standard messaging SS connected industries and educational institutions ".

Wireshark supports multiple platforms such as Uinx and windows. Compile a version (0.99.8) in Windows according to the official developer's guide ), the following are the compilation steps: (the same as the Win32 step-by-step guide of developer's guide ).

1. Install the VC compiler and platform SDK.

Wireshark can be compiled by any Compiler (except vs2003 Toolkit) between vc6 and vc9 in windows. "Don't use cygwin's GCC !." GCC (windows of course) cannot be compiled correctly or requires some effort to compile it correctly. Therefore, GCC is not recommended in the manual.

The Platform SDK is installed by default when Visual Studio is installed, so additional installation is required. Visual Studio not installed? Right? Go to the street and follow the installation instructions after buying a version of 5 RMB/CD. Download from the Internet? In addition, msdn is a little large, and it is convenient to buy a dashboard on the street.

Note: During installation, you must set vcvars32.bat as the system variable or call vcvars32.bat before compilation.

2. Install cygwin

Download the cygwin installation program and start installation ....... If the network speed is not fast enough, you can download the local installation package for installation (it is said that there are 500-600 m, it seems not small ).

Whether it is online or local installation, check the following required packages. These packages are not installed by default during cygwin installation:

· Archive/unzip
· Devel/Bison
· Devel/flex
· Interpreters/perl
· Utils/patch
· Web/wget
Select method: Expand and click skip to change it to the version number.

3. Install Python

Install python2.4. In the instruction manual, 2.5 may be faulty, but my version is 2.5. Compilation is not prone to any problems.

4. Install the Subversion Client

This step is not mandatory and can be ignored.

5. Get source code

After obtaining the source code, you must modify the config. nmake file of the source code to specify the corresponding tool and related information. The main modifications are as follows:

1. Set version information

Version_extra: Specifies the version number of the custom compilation, in the string format, for example, "-SVN-12345 ".

2. Path settings

Program_files: the installation directory of the application, generally C:/program files. Note that if the application is not installed under the same drive letter, problems may occur:

For example:

Hhc_dir = $ (program_files)/HTML Help Workshop // used to generate a Help file. It seems that C:/program files is installed by default during system installation.

Msvcr_dll = $ (program_files)/Microsoft Visual Studio 8/VC/redist/x86/Microsoft. vc80.crt /*. * // used for production and installation, reporting the VC Runtime Library

Wireshark_libs = E:/mycode/Wireshark/src/wireshark-win32-libs // the path of the dependent library, which can be automatically obtained through the MAKEFILE file;

Msvc_variant = msvc2005 // specify the compiler type

3. Set database information

Follow the default settings.

4. Tool settings

Cygwin_path = D:/cygwin/bin // cygwin installation path

Python = "D:/python25/python.exe" // set the python path

Makensis = "D:/program files/NSIs/makensis.exe" // set the path of the NSIs packaging Tool

Install2_dir = E:/mycode/Wireshark/wireshark-gtk2 // compile the output file path (for the gtk2 Version)

6. Set the command line Environment

It mainly sets environment variables for VC so that nmake can be directly run in the command line. Set the current directory to the directory of the wireshark source file.

7. Compile Wireshark

You can compile the above settings. The specific steps are as follows:

1. Verify that the tool is correctly installed

> Nmake-F makefile. nmake verify_tools

The command will output information similar to the following:

Checking for required applications:
CL:/cygdrive/C/programme/Microsoft Visual Studio 8/VC/bin/Cl
Link:/cygdrive/C/programme/Microsoft Visual Studio 8/VC/bin/Link
Nmake:/cygdrive/C/programme/Microsoft Visual Studio 8/VC/bin/nmake
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
Env:/usr/bin/env
C:/python24/python.exe:/cygdrive/C/python24/python.exe
Sed:/usr/bin/SED
Unzip:/usr/bin/unzip
Wget:/usr/bin/wget

2. Download the installation Library File

> Nmake-F makefile. nmake setup

Using wget to download and install library files may take some time.

3. distclean source file

> Nmake-F makefile. nmake distclean

Wireshark source code contains some files prepared for Unix compilation. You must be clear about your source files before the first compilation.

4. Compile Wireshark

> Nmake-F makefile. nmake all

Compile wireshark.exe to check whether the compilation is successful.

If the compilation fails, modify it according to the corresponding error prompt.

8. Create an installer (not required)

To create an installer, complete the following steps:

1. Download and install NISS

After NISS is installed, you must install the NISS program and set the makensis parameter in the config. nmake file correctly.

2.obtain vcredist_x86.exe

Copy the re-release program of the C-run library of VC to $ (wireshark_libs.

3. Generate the installer

> Nmake-F makefile. nmake Packaging

After the installation is successful, the generated installer is in the/packaging/NSIs path of the source code. You can verify that the installer is correct on other computers ....

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.