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] How to compile Ethereal with a successor of Visual Studio 6

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

From: "Laurent Rabret" <laurent_rabret@xxxxxxxxxxx>
Date: Thu, 10 Feb 2005 00:15:06 +0100
Hi,
I've tried to install ethereal according to the description I sent yesterday. There were some precisions to add...
Here's a new text with a proposal: To be "transparent" to the Visual Studio release (6 or above), we would have just to add zlib sources in the Ethereal branch. Do you think it's a valuable idea?
Regards
Laurent
-------------------------------------------------------------------------------------------------------------------------
This text aims at describing all the steps needed to successfully compile Ethereal using a successor of Microsoft Visual Studio 6 (e.g. Visual Studio .NET 2003).
Because it's not compulsory to buy the latest Microsoft compiler, we'll start by referencing important URLs from which you'll be able to download the free distribution of the compiler. We just point out that this free distribution does not include nice features like an IDE or the ability to perform step by step debugging etc... So, it's up to you! Anyway, those who have Visual Studio .NET can directly jump to section 2.
-------------------------------------------------------------------------------------------------------------------------
1) Installing the free distribution of Microsoft Visual C compiler.
Strangely, the Visual C++ Toolkit does not include important tools like nmake so this package is definitively not a good choice and you'll have to install its superset: the .NET framework SDK. http://go.microsoft.com/fwlink/?LinkId=77
When done, you must install the platform SDK that is necessary to activate your C development platform. For example, the SDK provides win32.mak that is required to build win32 applications with nmake. As far as we are concerned, only the Core SDK is required...
http://go.microsoft.com/fwlink/?LinkId=4435
NB: to use the compiler, some environment variables must be set up. The .NET framework SDK ships a helper to fulfill this task: sdkvars.bat. Before starting a compilation process, don't forget to launch this batch file first.
OK, you've got the brand new Microsoft C/C++/C# compiler installed and ready to use. It's now time to dive into the real subject of this thread!
-------------------------------------------------------------------------------------------------------------------------
2) Compiling the Ethereal solution
As you'll see, just a few files must be adapted for VS .NET to compile Ethereal...
Of course you must follow all the requirements described from this URL, http://www.ethereal.com/development.html. In addition, you must take care of one critical point : Zlib, wiretap (a library provided with Ethereal) and ethereal (the application) must use the same standard libraries (e.g. msvcr71.dll). Therefore, to be sure ethereal works, you have to compile and link Zlib with the compiler installed in your machine.
NB: When all the compilation process passed, you can check what standard library is called with depends, a tool provided with Visual Studio, the platform SDK or available for free from http://www.dependencywalker.com/
-------------------------------------------------------------------------------------------------------------------------
To compile Zlib:
- download the source code from this site http://www.zlib.org/ It's a good idea to explode the zip file from the folder containing all ethereal libraries (usually blablabla\ethereal-win32-libs) ;
- start a shell in the Zlib root folder and simply enter: nmake -f win32\makefile.msc
NB: the .NET framework SDK does not include the lib application which is a simple wrapper around link /lib. Therefore, if Zlib does not link, edit win32\Makefile.msc and change the line
AR = lib
by
AR = link /lib
-------------------------------------------------------------------------------------------------------------------------
You must now �tune� your config.nmake file (in the ethereal root folder). Edit it and perform all these modifications in addition to your standard adaptations:
Change
LOCAL_LDFLAGS=/DEBUG
by
LOCAL_LDFLAGS=/DEBUG /NODEFAULTLIB:libc /NODEFAULTLIB:msvcrtd /DEFAULTLIB:msvcrt /MACHINE:I386
and
ZLIB_CFLAGS=/I$(ZLIB_DIR)\include
ZLIB_LIBS=$(ZLIB_DIR)\lib\zdll.lib
by
ZLIB_CFLAGS=/I$(ZLIB_DIR)
ZLIB_LIBS=$(ZLIB_DIR)\zdll.lib
-------------------------------------------------------------------------------------------------------------------------
Now, open Makefile.nmake files in the following plugin folders :
- asn1
- mate
- mgcp
and change the command:
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
by
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386
-------------------------------------------------------------------------------------------------------------------------
At last, in case you want to create a nsis installer, don't forget to add the standard library in your nsis script!
That's it! You can now compile ethereal with VS .NET...