2.5. C compiler

2.5.1. UNIX: GCC (GNU compiler collection)

[Note]Win32 Note!

Although some effort is currently made to use gcc from the Cygwin environment, the mainline for several reasons is still using Microsoft Visual Studio's C compiler.

The GCC C compiler is available for most of the UNIX-like platforms and as the gcc package from the Cygwin setup.

If GCC isn't already installed and also not available as a package for your platform, you can get it at: http://gcc.gnu.org/.

After correct installation, typing inside the bash:

$ gcc --version

should result in something like:

gcc (GCC) 3.3.3 (cygwin special)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	

However, the version string may vary.

2.5.2. Win32 native: Microsoft Visual Studio version 6 C compiler

[Note]Note!

The Microsoft Visual Studio is not free software. This is a tool you have to buy before you use it!

The mainline for generating Ethereal on the windows platform, is using the compiler cl.exe from the Microsoft Visual Studio version 6 (and it's nmake, as described below).

After correct installation, typing inside the command line (cmd.exe):

> cl

should result in something like:

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]
	

However, the version string may vary.

2.5.3. Win32 native: Microsoft Visual Studio .NET (and alike) C compilers

[Warning]Warning!

The recent "Microsoft Visual Studio .NET" C compiler(s) currently cannot be used to compile Ethereal!!!

The following is a problem summary for:

All containing version 7 or later of Microsoft's C compiler.

It is reported that this compiler requires to ship a MSVCRT70.dll together with the compiled exe, which contains the C runtime library. This conflicts, as all required libraries currently compiled with (and uses) MSVCRT.dll (the older version 6 one).

Example why this hurts: A dependant library might try to open a file using functions in MSVCRT.dll which creates an internal file handle and keeps information about that file. When Ethereal tries to read data from that file, it uses the functions from MSVCRT70.dll, which doesn't know anything about that previously opened file and returns an error code.

There where also attempts to bring the compiler to use only the old MSVCRT.dll but they seemed to fail :-(

It's also still unsure, if shipping the MSVCRT70.dll together with Ethereal is compatible with the GPL license at all.

[Note]Note!

This isn't an Ethereal specific problem. Any software project trying to use the version 7 C compiler will have the problems described above!

XXX - what about the legal issue, as the MSVCRT70.dll had to be shipped with Ethereal.