How to Build Ethereal 0.10.4 on Windows XP

So I needed to build Ethereal from source on Windows XP. It wasn’t as easy as building from source on *nix or MacOS X, so I’ve compiled some info about how I did it, in case anyone else will find it useful.

Read more to see the steps that worked for me (and others). How I got Ethereal 0.10.4 to compile on Windows XP (note: there’s more tips at the bottom from a reader):

Requirements: - Microsoft Visual C++ 6 – Not Free: http://msdn.microsoft.com/visualc/ - Cygwin – Free: http://www.cygwin.com/

  1. Download and extract the Ethereal 0.10.4 source tarball from Ethereal’s site

  2. README.win32 says:

Be sure that your command-line environment is set up to compile and link with MSVC++. When installing MSVC++, you can have your system’s environment set up to always allow compiling from the command line, or you can invoke the vcvars32.bat script, which can usually be found in the “VC98\Bin” subdirectory of the directory in which Visual Studio was installed.
  1. From CMD.exe:

    cd ethereal-0.10.4 nmake -f Makefile.nmake setup

  2. I couldn’t compile successfully unless I made a few changes to the Makefile.nmake file:

    • find these lines:

AUTHORS-SHORT: AUTHORS make-authors-short.pl $(PERL) make-authors-short.pl < AUTHORS > AUTHORS-SHORT

  • change the above lines to have a # in front of them (commenting them out):

AUTHORS-SHORT: AUTHORS make-authors-short.pl

$(PERL) make-authors-short.pl < AUTHORS > AUTHORS-SHORT

  • now, right above the AUTHORS-SHORT: line that you commented out, insert this line:

AUTHORS-SHORT: AUTHORS

  • find this line:

EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe

  • change the above line to this (remove mergecap.exe):

EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe editcap.exe text2pcap.exe

  1. Make sure these tools are installed with Cygwin (thanks to http://www.csie.nctu.edu.tw/~smhuang/02build_ethereal.html#2):

    • Devel -> bison
    • Devel -> flex
    • Interpreters -> python
    • Interpreters -> perl
    • Xfree86 -> Xfree86-xserv (for GUI)
    • NOTE: I couldn’t find Xfree86 -> xfree86-xserv in Cygwin, but I can’t remember if I chose something similar or not; I think I skipped this one.
  2. From CMD.exe:

    cd ethereal-0.10.4 nmake -f Makefile.nmake

  3. You just created a bunch of DLLs in the $ETHEREAL_LIBS directory (specified in config.nmake, defaults to c:\ethereal-win32-libs). Now we need to copy them to your ethereal-0.10.4 directory. Here’s a list of the directories/files:

  • gettext-runtime-0.13.1\bin\
    • asprintf.dll
    • intl.dll
  • glib\bin\
    • libglib-2.0-0.dll
    • libgmodule-2.0-0.dll
    • libgobject-2.0-0.dll
    • libgthread-2.0-0.dll
  • gtk+\lib\
    • libgdk-0.dll
    • libgtk-0.dll
  • libiconv-1.9.1.bin.woe32\bin\
    • charset.dll
    • iconv.dll
  • pcre-4.4\bin\
    • pcre.dll
  • zlib121-dll\
    • zlib1.dll
  1. Inside your Ethereal source dir, there’s a dir called wiretap, and insite there you’ll find a wiretap dll that you need to copy to your ethereal source dir.

  2. Now you can run ethereal.exe =-)

Updates: Thanks to Mike Perry for contributing the following feedback:

Some things that you had to do I did not, but I also ran into a couple of snags you didn’t mention. I’m using Vis Studio 2k3 + ethereal 10.5 + latest cygwin on WinXP. I think the major differences were: 1. I did not have to make any of your mods to the Makefile.nmake 2. I did have to edit config.nmake to change the python var to be PYTHON=”c:\cygwin\usr\bin\python.exe”. 3. Several of the yacc files generated incorrect headers. I had to change wiretap/ascend-scanner.c and /epan/dfilter/scanner.c to include io.h instead of unistd.h (http://www.ethereal.com/lists/ethereal-users/200211/msg00053.html) 4. I needed to change the distributed pcap header file /cygdrive/c/ethereal-win32-libs/wpdpack/Include/PCAP.H to include winsock2.h instead of sys/time.h (http://www.ethereal.com/lists/ethereal-dev/200205/msg00052.html mentions including winsock.h, but winsock2.h was required for me) 5. Apparently there is some conflict between the msvcr71.dll that ships with VC7 and the msvcrt.dll that was used to build the ethereal-win32-libs support files. Thus, you need both the msvcrt.lib from Vis Studio 6 and c:\program files\MS VS .NET\Vc7\crt\src\intel\dll_lib\ftol2.obj to be present in c:\ethereal-win32-libs\. 6. Then you must edit config.nmake and change LOCAL_LDFLAGS to LOCAL_LDFLAGS=/DEBUG /NODEFAULTLIB:LIBC /NODEFAULTLIB:MSVCRT $(ETHEREAL_LIBS)\msvcrt6.lib $(ETHEREAL_LIBS)\ftol2.obj 7. With these changes, all exe’s will now build (with no changes needed to the EXECUTABLES line). Unfortunately, however, while ethereal-gtk2 does build, it segfaults immediately when you run it.

Please let me know if this works for you or if I missed anything that you are able to spot (I probably missed lots (this was written after my compile success)).

  • Gabe Hollombe (gabe AT avantbard.com)

Comments are closed.