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: Wed, 09 Feb 2005 02:01:08 +0100
Hi,
I finaly wrote a simple text to explain how to compile Ethereal with Visual Studio .NET and hope it'll be clear... (I wrote it in a hurry). It would be nice if someone could follow the procedure and report some feedback... Some enhancements may be required.
Regards
Laurent
{\rtf1\ansi\ansicpg1252\deff0\deflang1036{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2 Times New Roman;}{\f2\fnil\fcharset2 StarSymbol;}{\f3\fswiss\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue0;} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang1023\f0\fs24 This paragraph 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).\par \par 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.\par \f1 -------------------------------------------------------------------------------------------------------------------------\par \pard\fi-283\li283\f0 1) Installing the free distribution of Microsoft Visual C compiler.\par \pard\li283\par \pard 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/\fs20 fwlink/?LinkId=77\cf1 \cf0\fs24\par When done, it's usually a good idea to add the platform SDK. Actually, I don't remember whether or not the SDK must be installed but for sure, it's wise to have it... http://go.microsoft.com/\fs20 fwlink/?LinkId=4435\cf1 \cf0\fs24 As far as we are concerned, only one part, the Core SDK, should be important...\par \par NB: to use the compiler, some environment variables must be set up. The .NET framework SDK ships a helper to fulfill this task: vsvars32.bat. Before starting a compilation process, don't forget to launch this batch file first.\par \par OK, you've got the latest Microsoft C/C++/C# compiler installed and ready to use. It's now time to dive into the real subject of this thread!\par \f1 -------------------------------------------------------------------------------------------------------------------------\par \pard\fi-283\li283\f0 2) Compiling the solution\par \pard\li283\par \pard As you'll see, just a few files must be adapted for VS .NET to compile Ethereal...\par Of course you must follow all the requirements described from this URL, http://www.ethereal.com/development.html but you must take care of one critical point : Zlib, wiretap (a library provided with Ethereal) and ethereal (the application) \b must\b0 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.\par \f1 -------------------------------------------------------------------------------------------------------------------------\par \f0 To compile Zlib:\f1\par \pard\fi-283\li283\f2\fs18\'13\f0\fs24 download the source code from this site http://www.zlib.org/ It's a good idea to explode the zip \f1 file from the folder containing all ethereal libraries (usually blablabla\\ethereal-win32-libs) ;\par \f2\fs18\'13\f1\fs24 Start a shell in the Zlib root folder and simply enter: nmake -f win32\\makefile.msc\par \pard\par NB: the .NET framework SDK does not include the lib application\lang1036\f0 which is\lang1023\f1 a simple wrapper around link /lib. Therefore, if Zlib does not link, edit \lang1036\f0 win32\\\lang1023\f1 Makefile.msc and change the lin\lang1036\f0 e\par \lang1023\f1 AR = lib\par by\par AR = link /lib\par -------------------------------------------------------------------------------------------------------------------------\par You must now \ldblquote tune\rdblquote your config.nmake file (in the ethereal root folder). Edit it and perform all these modifications:\par change\par LOCAL_LDFLAGS=/DEBUG\par by\par LOCAL_LDFLAGS=/DEBUG /NODEFAULTLIB:libc /NODEFAULTLIB:msvcrtd /DEFAULTLIB:msvcrt /MACHINE:IX86\par and\par ZLIB_CFLAGS=/I$(ZLIB_DIR)\\include\par ZLIB_LIBS=$(ZLIB_DIR)\\lib\\zdll.lib\par by\par ZLIB_CFLAGS=/I$(ZLIB_DIR)\par ZLIB_LIBS=$(ZLIB_DIR)\\zdll.lib\par -------------------------------------------------------------------------------------------------------------------------\par Now, open Makefile.nmake files in the following plugin folders :\par \pard\fi-283\li283\f2\fs18\'13\f1\fs24 asn1\par \f2\fs18\'13\f1\fs24 mate\par \f2\fs18\'13\f1\fs24 mgcp\par \pard and change the \lang1036\f0 command\lang1023\f1 :\par LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)\par by\par \pard\sa283 LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386\par -------------------------------------------------------------------------------------------------------------------------\par At last, in case you want to create a nsis installer, don't forget to add the standard library in your nsis script!\par That's it! You can now compile ethereal\lang1036\f0 with VS .NET\lang1023\f1 ...\par \pard\lang1036\f3\fs20\par }