*********************************************************************
*                                                                   *
*                            LEDA                                   *
*                                                                   *
*                  Windows 95/98/NT/2000/XP                         *
*                         MSVC++ 7.1                                *
*                      Static Libraries                             *
*                                                                   *
*                    Installation and Usage                         *
*                                                                   *
*********************************************************************


This file describes the installation and usage of static libraries 
of LEDA with Microsoft Visual C++ .NET. 


Remark: This file describes the situation in a GUI package of 
LEDA. If you have the geometry, graph, or basic package only the 
corresponding libraries are provided. 


0. Contents of File
-------------------

I. Preparations
II. Files and Directories
III. Compiling and Linking in Microsoft Visual C++ .NET
IV. Compiling and Linking Application Programs in a DOS-Box
V. Example programs and demos


I. Preparations 
---------------

To install LEDA you only need to execute the LEDA distribution file 
LEDA-<ver>-<package>-win32-<compiler>.exe. During setup you can 
choose the name of the LEDA root directory and the parts of LEDA you 
want to install. Then you have to set the environment variable 
LEDAROOT as follows: 

1. Windows NT/2000/XP: On these platforms LEDARROOT is set 
automatically to the directory where you installed LEDA by the setup 
program. 

2. Windows 95/98: 
(a) Add the line set LEDAROOT=<LEDA> to the file "autoexec.bat" where 
<LEDA> is the root directory of your LEDA installation, e.g., 
D:\LEDA-5.0\ 
(b) Restart Windows 95/98 for the change to take effect. 


II. Files and Directories 
-------------------------

To compile and link your programs with LEDA, the LEDA main directory 
should contain the following files and subdirectories: 

Readme.txt                  Readme File 
Install\win32_msc70_lib.txt this file 
incl\                       the LEDA include directory 
license.txt                 License file

and at least one of the following library sets 

libl_ml.lib, libg_ml.lib, libp_ml.lib, libw_ml.lib, 
libgeow_ml.lib, libd3_ml.lib 

libl_mld.lib, libg_mld.lib, libp_mld.lib, 
libw_mld.lib, libgeow_mld.lib, libd3_mld.lib 

libl_md.lib, libg_md.lib, libp_md.lib, libw_md.lib, 
libgeow_md.lib, libd3_md.lib 

libl_mdd.lib, libg_mdd.lib, libp_mdd.lib, libw_mdd.lib,
libgeow_mdd.lib, libd3_mdd.lib 
 
libl_mt.lib, libg_mt.lib, libp_mt.lib, libw_mt.lib,
libgeow_mt.lib, libd3_mt.lib 
 
libl_mtd.lib, libg_mtd.lib, libp_mtd.lib, libw_mtd.lib,
libgeow_mtd.lib, libd3_mtd.lib

III. Compiling and Linking in Microsoft Visual C++ .NET 
-------------------------------------------------------

To compile and link an application program using LEDA in Microsoft 
Visual C++ .NET proceed as follows: 
(1) In the "File" menu of Visual C++ .NET click on "New->Project". 
(2) Choose "Visual C++ Projects" as project type and "Win32 Project" 
as template. Enter a project name, choose a directory for the 
project, and click "OK" 
(3) In the Win32 Application Wizard click on "Application Settings", 
choose "Console Application" and "Empty Project", and click "Finish" 
(4) After clicking "OK" you have an empty project space 

If you already have a source file prog.cpp: 
(5) Activate the file browser and add prog.cpp to the main folder of 
your project 
(6) In the Solution Explorer of your project click on "Source Files" 
with the right mouse button, then click on "Add-> Add Existing Item" 
with the left mouse button 
(7) Double click on prog.cpp 

If you want to enter a new source file: 
(5') In the Solution Explorer of your project click on "Source Files" 
with the right mouse button, then click on "Add-> Add New Item" with 
the left mouse button. 
(6') Choose "C++ File" in Templates, enter a name, and click "Open". 
(7') Enter your code. 

(8) In the Solution Explorer right click on your project and left 
click on "Properties" 
(9) Click on "C/C++" and "Code Generation" and choose the 
"Run Time Library" (=compiler flag) you want to use. 
The default value is "/MLd", alternatives are "/ML", "/MD", "/MDd", 
"/MT", and "/MTd". Notice that you have to use the LEDA libraries 
that correspond to the chosen flag, e.g., with option "/MD" you must 
use libl_md.lib, libg_md.lib, libp_md.lib, libw_md.lib, 
libgeow_md.lib, and libd3_md.lib. Using another set of libraries 
with "/MD" could lead to serious linker errors. 

(10) Click on "Linker" and "Command Line" and add the name of the 
LEDA libraries you want to use in "Additional Options" as follows. 
We use <opt> to indicate the compiler option chosen in Step (9) 
(,e.g., <opt> is mld for "/MLd"). 

libl_<opt>.lib 
for programs using only basic data types of LEDA 

libg_<opt>.lib libl_<opt>.lib 
for programs using graph data types 

libp_<opt>.lib libg_<opt>.lib libl_<opt>.lib 
for programs using geometric data types 

libd3_<opt>.lib libp_<opt>.lib libg_<opt>.lib libl_<opt>.lib\
wsock32.lib 
for programs using three-dimensional data types 

libw_<opt>.lib libp_<opt>.lib libg_<opt>.lib libl_<opt>.lib\ 
wsock32.lib 
for programs using graphics data types 

libgeow_<opt>.lib libd3_<opt>.lib libw_<opt>.lib libp_<opt>.lib\ 
libg_<opt>.lib libl_<opt>.lib wsock32.lib 
for programs using GeoWin 

Alternatively, you can include <LEDA/msc/autolink_static.h> in your 
program and the correct LEDA libraries are linked to your program 
automatically. If GeoWin is used you need to add "_LINK_GeoW" to the 
"Preprocessor definitions" in Step (9). Notice that 
autolink_static.h only works correctly for the GUI package of LEDA. 

(11) Click "OK" to leave the "Settings" 

(12) In the "Tools" menu click on "Options" 
(13) Click on "Projects->VC++ Directories" 
(14) Choose "Include Files" in "Show Directories for:" and add the 
directory <LEDA>\incl containing the LEDA include files (Double click 
on the small rectangle in "Directories", enter <LEDA>\incl, or click 
on the small grey rectangle on the right and choose the correct 
directory.) 
(15) Choose "Library Files" in "Show Directories for:" and add the 
directory <LEDA> containing the LEDA libraries. 
(16) Click "OK" to leave the "Options" 

(17) In the "Build" menu click on "Build <Project> " or 
"Rebuild <Project>" to compile your program. 
(18) In the "Build" menu click on "Execute prog.exe" to execute your 
program. 

Remark: If your C++ source code files has extension .c, you need to 
add the option "/TP" in "Project Options" (similar to Step (9)), 
otherwise you will get a number of compiler error. (Click on "C/C++" 
and "Command Line". Add /TP in "Additional Options" and click 
"Apply".) 

To add LEDA to an existing Project in Microsoft Visual C++ .NET, 
start the Microsoft Visual Studio with your project and follow Steps 
(8)-(16) above. 


IV. Compiling and Linking Application Programs in a DOS-Box
-----------------------------------------------------------

(a) Setting the Environment Variables for Visual C++: 
The compiler CL.EXE and the linker LINK.EXE require that the 
environment variables PATH, INCLUDE, and LIB have been set properly. 
When Visual C++ was installed, setup created a batch file, 
VSVARS32.BAT, containing commands to modify PATH, LIB, and INCLUDE. 
Run VSVARS32.BAT at the command prompt before you compile your 
application program. VSVARS32.BAT is located in the \bin subdirectory 
of your compiler installation, e.g., c: \programs \microsoft visual 
studio .NET \Vc7 \bin. To compile programs together with LEDA, the 
environment variables PATH, LIB, and INCLUDE must additionally 
contain the corresponding LEDA directories. 

(b) Setting Environment Variables for LEDA: 
(i) Windows NT/2000/XP: 
1. In the "Start" menu, point to "Settings", then click 
"Control Panel". 
2. In the "Control Panel", double click "System". 
3. In the System Properties dialog box, click the Environment tab 
(for NT), respectively the Extended tab and then on 
"Environment Variables" (for 2000/XP). 
If a user variable PATH, LIB, or INCLUDE already exists, extend the 
current value as follows: 

extend PATH by <LEDA> 
extend INCLUDE by <LEDA>\incl 
extend LIB by <LEDA> 
Otherwise add new a user variable PATH, INCLUDE, or LIB with value 
<LEDA>, respectively <LEDA>\incl. 

(ii) Windows 95/98: 
1. Change the file autoexec.bat as follows: 
If a variable PATH, INCLUDE, or LIB is already set, append the 
appropriate LEDA directory <LEDA>, respectively <LEDA>\incl. 
Otherwise add a corresponding line to autoexec.bat: 

set PATH=<LEDA> 
set INCLUDE=<LEDA> \incl 
set LIB=<LEDA> 

2. Restart Windows 95/98 for the change to take effect.
 
After these procedures, it suffices to call VSVARS32.BAT at the 
command prompt. In both cases the LEDA paths are automatically 
appended to the compiler paths. 

(c) Compiling and Linking Application Programs: 

After setting the environment variables, you can use the LEDA 
libraries as follows to compile and link programs. 

Programs using basic data types: 

cl <option> -TP prog.c <libl.lib>

Programs using graph data types: 

cl <option> -TP prog.c <libg.lib> <libl.lib>

Programs using geometric data types: 

cl <option> -TP prog.c <libp.lib> <libg.lib> <libl.lib>

Programs using three-dimensional data types: 

cl <option> -TP prog.c <libd3.lib> <libp.lib> <libg.lib> <libl.lib>

Programs using graphics data types: 

cl <option> -TP prog.c <libw.lib> <libp.lib> <libg.lib> <libl.lib>\
wsock32.lib user32.lib gdi32.lib comdlg32.lib shell32.lib\ 
advapi32.lib

Programs using GeoWin: 

cl <option> -TP prog.c <libgeow.lib> <libd3.lib> <libw.lib>\
<libp.lib> <libg.lib> <libl.lib> wsock32.lib user32.lib gdi32.lib\
comdlg32.lib shell32.lib advapi32.lib

Possible values for <option> are "-ML", "-MLd", "-MD", "-MDd", 
"-MT", and "-MTd". You have to use the LEDA libraries that 
correspond to the chosen <option>, e.g., with option "-MD" you must 
use libl_md.lib, libg_md.lib, .... Using another set of libraries 
with "-MD" could lead to serious linker errors. 

Remark: The option -TP is necessary if the C++ source code files 
have extension .c. If your files have extension .cpp this option is 
not necessary. 


V. Example programs and demos 
-----------------------------

The source code of all example and demo programs can be found in the 
directory <LEDA>\test and <LEDA>\demo. Goto <LEDA> and type make_test 
or make_demo to compile and link all test or demo programs, 
respectively. 


VI. User Manual
---------------

The HTML version of the user manual is contained in every
distribution. Postscript, PDF, and HTML versions 
of the manual are also available at 

             http://www.algorithmic-solutions.com
