At present, under MS-Windows™ LEDA supports the development environments MS Visual studio 6, MS Visual C++ .NET, Borland C++, and the Unix™ emulating environment cygwin. For the latter applies what was said in Section 1.3.1.
Most developers write, compile, link, and execute their programs within one of these integrated development environments. Detailed user instructions for all these environments would go beyond the scope of this introduction. All details are described on the corresponding manual page “Technical Information”.
To give the LEDA freshman a first, guaranteed feeling of
success, we describe in this section merely how we can compile
and execute HelloLEDAWorld.C in a DOS box
under MS-Windows™ NP/2000/XP with the compiler of the
Visual Studio 6. (This should be the
most common compiler at present.)
Furthermore we assume that we use the MDd-DLLs (Multithreaded DLL Debug) as the runtime library of the compiler. MDd-DLL versions are also contained in the evaluation version of LEDA; so these are always installed on our system.
In addition, the full version of LEDA contains static libraries and DLLs for all of the 6 compiler options MD, MDd, ML, MLd, MT, and MTd. The partitioning of LEDA's classes into static libraries is the same as under Unix™, see Table 1.1 for that. The dynamic libraries always come in pairs. They are called in compliance with the options
leda_md.lib, leda_md.dllleda_mdd.lib, leda_mdd.dllleda_ml.lib, leda_ml.dllleda_mld.lib, leda_mld.dllleda_mt.lib, leda_mt.dllleda_mtd.lib, leda_mtd.dll.
Linking has to be performed against the files
leda_xxx.lib; the files
leda_xxx.dll however are required at
runtime. In contrast to the Unix™ version, the complete LEDA system is
contained in these libraries (with the exception of the code for
GeoWin, see again Table 1.1 for this).
The compiler CL.EXE and the
linker LINK.EXE require that the
environment variables PATH,
INCLUDE and LIB be
set suitably. During the installation of Visual
C++ the setup program has created a batch file
named VCVARS32.BAT, which contains
commands for adapting these three variables suitably.
VCVARS32.BAT must be started once
from the command line before application programs can be
compiled. VCVARS32.BAT is located in the
subdirectory bin of the compiler
installation, for example in c:\programs\microsoft visual
studio 6\vc98\bin. To be able to compile programs
together with LEDA, the variables PATH,
LIB and INCLUDE must
additionally include the corresponding LEDA
directories.
In the following, we denominate the root directory of
LEDA by <LEDAROOT>. This is the
directory that we have specified during the installation
procedure as the installation directory. We execute the
following steps successively:
In the menu we click on , then on .
We double-click in .
The last step depends on the version of our operating system:
If an environment variable
PATH, LIB, or
INCLUDE already exists, we expand its current value as follows
PATH by <LEDAROOT>.INCLUDE by <LEDAROOT>\incl.LIB by <LEDAROOT>.
If one or all of these variables do not exist, we
add a new user variable PATH,
LIB and/or INCLUDE
with value <LEDAROOT> and
<LEDAROOT>\incl,
respectively.
After we have executed these steps, we must invoke
VCVARS32.BAT from the command line.
After the environment variables have been set, we can use the LEDA
libraries to compile and link
HelloLEDAWorld.C
(the file itself be located for example in the directory
mydir) as follows :
C:\mydir> cl -MDd -DLEDA_DLL -Tp HelloLEDAWorld.C leda_mdd.lib
Here the option -MDd specifies the
runtime library of the compiler (Multithreaded DLL Debug)
and the flag -DLEDA_DLL is necessary to
be able to use the DLL version of LEDA (this one is
contained in the evaluation version).
The option -Tp is always necessary
when the C++ source files do not end on
.cpp in order to tell the compiler that
it is facing C++ source code.
Now, an executable file should have been made:
C:\mydir> dir HelloLEDAWorld.*
HelloLEDAWorld HelloLEDAWorld.C
Hooray! We are now ready to make a large step on our way to a perfect LEDA developer:
C:\mydir> HelloLEDAWorld
Hello LEDA world!
And as mentioned before, from now on the remainder is no longer hard ...