Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] Questions & Lessons building on Win32

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Donnie Hale" <donnie@xxxxxxxxxxxxxx>
Date: Tue, 13 Apr 2004 01:10:59 -0400
As I want to look into some utilities to massage captures w/ TCP segments, I
downloaded the source distribution, all the required libraries, and
attempted to build the 0.10.3 version of ethereal. Please note that I am
using Visual Studio .NET 2003 (from its command prompt), python (windows
version) 2.2, and the latest download of cygwin stuff. The main ambiguity in
reading the README.win32  file was the comment, "but the files listed below
as being generated by Flex can be used when building on Windows only when
generated by a Windows version of Flex". I assumed that the cygwin version
of flex would work, and it seemd to; but as I'm still having problems,
perhaps that's the issue.

Here are some of the tweaks I had to make to get a build to complete:

1. my LOCAL_CFLAGS is now "/Zi /W3 /MDd -DWIN32"
The /MDd is because the include of win32.mak defaults to /MDd. The -DWIN32
is to avoid a compiler error in wpdpack/Include/PCAP.H indicating a missing
sys/time.h file. That include won't get hit if WIN32 is properly defined.

2. my LOCAL_LDFLAGS is now "/DEBUG /NODEFAULTLIB:LIBC /NODEFAULTLIB:MSVCRT
/DEFAULTLIB:MSVCRTD".
This is to ensure that the correct C RTL is used. Since /MDd is specified,
MSVCRTD (the debug version) should be linked against.

3. ADNS_DIR=$(ETHEREAL_LIBS)\adns-1.0-win32-03
The docs specify an ADNS directory that has a "-01" suffix (not "-03" which
is the current version on the ethereal wb site.

With those changes, the compiles and links succeed. As far as I can tell, I
get all the .exe's and .dll's I should. I do get these messages from
pod2html at the end. I have not looked into these at all.

        bash pod2html                     --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
        bash pod2html                     --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
        cd ..
        tethereal.exe -G | perl doc\dfilter2pod.pl
doc\ethereal-filter.pod.template > doc\ethereal-filter.pod
        cd doc
        bash pod2html                     --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
        bash pod2html                      --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
        bash pod2html                      --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
/usr/bin/pod2html: idl2eth.pod: unterminated list at =head in paragraph 32.
ignoring.
        bash pod2html                      --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
/usr/bin/pod2html: mergecap.pod: unterminated list at =head in paragraph 28.
ignoring.
        bash pod2html                      --title="The Ethereal Network
Analyzer 0.10.3"  --noindex
/usr/bin/pod2html: text2pcap.pod: unterminated list at =head in paragraph
44.  ignoring.


I've tried to test some of the utilities and have had mixed results.
"tethereal" seemed to work OK on a simple capture file I'd been working
with. I didn't try anything elaborate (just -n -x -r). When I tried to run
ethereal-gtk2, I had some issues. At first, it would come up but wouldn't
open that same file that tethereal would open (Bad File Descriptor). Since
none of the DLLs that come with the libraries used to build ethereal are in
the directory where the .exe ends up, I created a "dist/bin" directory and
put all the .exe's and the wiretap.dll there. Then I copied over the rest of
the real binary install directory structure (diameter, etc, lib, plugins,
...) under that "bin" directory. At that point, the ethereal.exe failed with
an assertion error in toolbar.c. It seems that in this scenario, it wanted
"etc" and "lib" under "dist" rather than under the directory where the .exe
was (unlike in the binary distribution directory structure).

At that point, I could run ethereal-gtk2.exe. However, if I tried to open
that same capture file, I got the message that it couldn't open the file
"for some unknown reason". I realized I hadn't put the just-built plugin
DLLs under the bin directory. I tried putting the just-built version of
those DLLs there. That made things worse - access violation reading
0x00000000. I've tried a few other things without success. At this point, I
can't open files in the GUI; though it does come up.

Sorry for the length of this message. I'm trying to get a handle on all this
and have thus far been somewhat frustrated. Some questions / comments:

- Does anyone have any pointers on how to proceed to get this working?

- It seems that the "win32.mak" file that's being included from the MS
Visual Studio install may have changed a bunch with VS.NET 2003. It looks to
me like it's not providing much useful stuff any longer (a lot of the macros
used by Makefile.nmake are empty or marked as for "backward compatibility").
Perhaps it's time to retire its use?

- Some instructions on how to go from a just-built environment, with .exe's
and .dll's floating around in different directories, to what should
constitute a working environment would be helpful. If I could figure out how
to get from here to there, I'd write a draft of those.

- Intuitively, it seems to me that it would work best if I ran a just-built
.exe with the DLLs from the individual libraries I downloaded. As far as I
can tell, those DLLs are all the same as the ones in the 0.10.3 binary
distribution, except for the adns_dll.dll. The version in the binary
distribution is 1.0.0.0 (according to the version info under File
Properties"); while the version in the downloaded library is 1.0.0.3. I'm
not sure if that's the problem or not. If it is, it's a build-time problem,
not a runtime problem; as I get the same error at runtime using either DLL.

It's getting late at this point - I've got to call it a night. :) Any input
would be appreciated.

Donnie