Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Compilation

Boost.Geometry is a headers-only library. Users only need to include the library headers in their programs in order to be able to access definitions and algorithms provided by the Boost.Geometry library. No linking against any binaries is required.

Boost.Geometry is only dependant on headers-only Boost libraries. It does not introduce indirect dependencies on any binary libraries.

In order to be able to use Boost.Geometry, the only thing users need to do is to download and/or install Boost and specify location to include directories, so include directives of this scheme will work:

#include <boost/...>

Supported Compilers

Boost.Geometry library has been successfully tested with the following compilers:

Boost.Geometry uses Boost.Build, a text-based system for developing and testing software, to configure, build and execute unit tests and example programs. The build configuration is provided as a collection of Jamfile.v2 files.

For gcc, flag -Wno-long-long can be used to surpress some warnings originating from Boost.

Includes

The most convenient headerfile including all algorithms and strategies is geometry.hpp:

#include <boost/geometry.hpp>

This is the main header of the Boost.Geometry library and it is recommended to include this file.

Alternatively, it is possible to include Boost.Geometry header files separately. However, this may be inconvenient as header files might be renamed or moved occasionaly in future.

Another often used header is geometries.hpp:

#include <boost/geometry/geometries/geometries.hpp>

This includes definitions of all provided geometry types: point, linestring, polygon, ring, box. The file geometries.hpp is not included in the geometry.hpp headerfile because users should be given the liberty to use their own geometries and not the provided ones. However, for the Boost.Geometry users who want to use the provided geometries it is useful to include.

For users using multi-geometries:

#include <boost/geometry/multi/geometries/multi_geometries.hpp>

Advanced Includes

Users who have their own geometries and want to use algorithms from Boost.Geometry might include the files containing registration macro's, like:

#include <boost/geometry/geometries/register/point.hpp>

Performance

The enumeration below is not exhaustive but can contain hints to improve the performance:

Problems with Intellisense

Both versions of MSVC, 2005 and 2008 (including Express Editions) can hang trying to resolve symbols and give IntelliSense suggestions while typing in a bracket or angle bracket. This is not directly related to Boost.Geometry, but is caused by problems with handling by this IDE large C++ code base with intensively used templates, such as Boost and Boost.Geometry. If this is inconvenient, IntelliSense can be turned off:

(...)disabling IntelliSense in VC++. There is a file called feacp.dll in <VS8INSTALL>/VC/vcpackages folder. Renaming this file will disable Intellisense feature.

-- Intellisense issues in Visual C++ 2005


PrevUpHomeNext