next up previous contents index
Next: Platforms Up: Technical Information Previous: Usage   Contents   Index


Namespaces, Standard Compliance, and Interaction with other Libraries

If users want to use other software packages like ABACUS, CGAL, or STL together with LEDA in one project avoiding naming conflicts is an issue. As name spaces are not yet generally available LEDA offers a new prefixing mechanism to avoid name conflicts. The libraries from all object code packages as well as the ones produced from the source code package contain class name symbols with the common prefix "leda_". A macroing package allows users to use unprefixed class names as used in the manual pages in chapters Simple Data Types to [*].

All unprefixed type names are transfered to prefixed ones at compile time by the macros provided automatically by the inclusion of any LEDA header file. There's two consequences to this.

Remember that you have to prefix all LEDA class types yourself if you use -DLEDA_PREFIX.

The second issue of interaction concerns the data type bool which is part of the new C++ standard. However not all compilers currently support a bool type. LEDA offers bool either compiler provided or defined within LEDA if the compiler lacks the support. Some STL packages follow a similar scheme. To solve the existance conflict of two different bool type definitions we suggest to use LEDA's bool as STL is a pure template library only provided by header files and its defined bool type can be easily replaced.

Finally LEDA now supports also standard header names without the trailing ".h". Often mixed usage of old and new headers create link problems. LEDA can be forced to use standard header names by setting the flag LEDA_STD_HEADERS. If you compile LEDA using -DLEDA_STD_HEADERS on the compiler command line or by uncommenting the corresponding definition at the end of <LEDA/system.h> you will have symbols based on standard header files in the libraries. Note that all libraries have to be compiled with this flag enabled and that old and new header files cannot be used simultaneously.


next up previous contents index
Next: Platforms Up: Technical Information Previous: Usage   Contents   Index
LEDA research project
2000-02-09