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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.


[Caution] Caution

Boost.Geometry in Boost 1.73 deprecates support for the C++03 and will require C++14 from Boost 1.75 onwards

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 source code should successfully compile using any compiler with complete C++14 support.

For the actual list of currently tested compilers, check results of the library CI builds linked from the or inspect the CI services configuration files in the develop branch of the library repository.

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 files.

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


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:

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.

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>


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