31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• Make sure that there is a file ilink32.cfg in the \bin subdirectory of your<br />

compiler which sets the linker option for the Lib path. <strong>The</strong> author had to add<br />

the following line to ilink32.cfg :<br />

-L"c:\programs\Borland\cbuilder6\lib"<br />

(b) Compiling and Linking Application Programs:<br />

Now you can use the <strong>LEDA</strong> libraries as follows to compile and link your application<br />

programs. We use to indicate the root directory of your <strong>LEDA</strong> installation,<br />

e.g., c:\<strong>LEDA</strong>-4.4\.<br />

Programs using basic data types:<br />

bcc32 -D<strong>LEDA</strong>_DLL -P -I\incl -L prog.c leda.lib<br />

Programs using GeoWin:<br />

bcc32 -D<strong>LEDA</strong>_DLL -P -I\incl -L prog.c\<br />

libGeoW.lib leda.lib<br />

Remark: <strong>The</strong> option -P is necessary if the C++ source code files have extension .c.<br />

If your files have extension .cpp this option is not necessary.<br />

Example programs and demos<br />

<strong>The</strong> source code of all example and demo programs can be found in the directory<br />

\test and \demo. Goto and type make test or make demo to compile<br />

and link all test or demo programs, respectively.<br />

A.15 Namespaces and Interaction with other Libraries<br />

If users want to use other software packages like STL together with <strong>LEDA</strong> in one project<br />

avoiding naming conflicts is an issue.<br />

<strong>LEDA</strong> defines all names (types, functions, constants, ...) in the namespace leda. This<br />

makes the former macro–based prefixing scheme obsolete. Note, however, that the prefixed<br />

names “leda ...” still can be used for backward compatibility. Application programs have<br />

to use namespace “leda” globally (by saying "using namespace leda;") or must prefix<br />

every <strong>LEDA</strong> symbol with "leda::".<br />

<strong>The</strong> second issue of interaction concerns the data type bool which is part of the new C++<br />

standard. However not all compilers currently support a bool type. <strong>LEDA</strong> offers bool<br />

either compiler provided or defined within <strong>LEDA</strong> if the compiler lacks the support. Some<br />

STL packages follow a similar scheme. To solve the existance conflict of two different bool<br />

type definitions we suggest to use <strong>LEDA</strong>’s bool as STL is a pure template library only<br />

provided by header files and its defined bool type can be easily replaced.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!