Generated on Mon Aug 25 11:35:46 2008 for Gecode by doxygen 1.5.6

Compiling and linking against Gecode

Including header files

Deciding which header files must be included when using Gecode is quite straightforward. There are the following header files for inclusion:

Other functionality is available through a set of header files. For example to access the implementation of particular propagators, a particular header file must be included. The header file to be included is always mentioned in the documentation of the class or function.

Linking libraries

Setting the exact name for a library on a particular platform aside, inclusion of header files basically coincides with against which library must be linked. That is:

The functionality in Range and value iterators requires no library for linking. Reusing integer or set propagators of course require the integer or set library.

If there is a difference between library and DLL (such as on Windows) linking must be done against the appropriate library and the corresponding DLL must be available for execution (such as in the PATH environment variable).

The libraries contain code that is executed at link time (for registering part of the reflection functionality). If you create static libraries, this code will not be linked into your executable as it is not directly referenced. You will have to tell your linker to include all symbols from the library (e.g. using -Wl,--whole-archive on Linux). Please refer to your linker documentation.

Library names

Windows with Visual Studio

  • Support library and DLL: GecodeSupport.lib and GecodeSupport.dll
  • Kernel library and DLL: GecodeKernel.lib and GecodeKernel.dll
  • Search library and DLL: GecodeSearch.lib and GecodeSearch.dll
  • Integer library and DLL: GecodeInt.lib and GecodeInt.dll
  • Set library and DLL: GecodeSet.lib and GecodeSet.dll
  • CpltSet library and DLL: GecodeCpltSet.lib and GecodeCpltSet.dll
  • Minimodel library and DLL: GecodeMiniModel.lib and GecodeMiniModel.dll
  • Serialization library and DLL: GecodeSerialization.lib and GecodeSerialization.dll

Unix (Linux, MacOS X)

Depending on whether Gecode was compiled as a static or as a dynamic library, different filename suffixes are used on different Unix platforms. All library names follow the following scheme:

  • Support library: libgecodesupport.<EXT>
  • Kernel library: libgecodekernel.<EXT>
  • Search library: libgecodesearch.<EXT>
  • Integer library: libgecodeint.<EXT>
  • Set library: libgecodeset.<EXT>
  • CpltSet library: libgecodecpltset.<EXT>
  • Minimodel library: libgecodeminimodel.<EXT>
  • Serialization library: libgecodeserialization.<EXT>

where <EXT> depends on the library type and platform:

  • libgecode[...].a for static libaries on all Unix flavors
  • libgecode[...].so for shared libraries on Linux
  • libgecode[...].dylib for shared libraries on MacOS X

You can use for example

gcc -L$GPREFIX/lib -lgecodekernel

to link the kernel library, if the libraries are found in $GPREFIX/lib.