From charlesreid1

No edit summary
 
Line 23: Line 23:
Boost is just header files, so you need to link to them at compile time and <code>#include</code> the right files in your source code.
Boost is just header files, so you need to link to them at compile time and <code>#include</code> the right files in your source code.


Link to the getting started guide on the Boost website: http://www.boost.org/doc/libs/1_63_0/more/getting_started/unix-variants.html#build-a-simple-program-using-boost
Links:
 
* Boost website getting started guide: http://www.boost.org/doc/libs/1_63_0/more/getting_started/unix-variants.html#build-a-simple-program-using-boost
 
* Installing python boost: http://www.pyimagesearch.com/2015/04/27/installing-boost-and-boost-python-on-osx-with-homebrew/
 
* Simple boost graph library example: http://stackoverflow.com/questions/8812466/using-c-boosts-graph-library#8812709


=Old stuff=
=Old stuff=

Latest revision as of 01:32, 27 March 2017

Boost is a powerful set of libraries and header files that give you a lot of really useful functionality for C++.

http://www.boost.org/

Installing

Boost is mostly header files, which means there is no build process. You can install Boost by downloading the header files, or by using a package manager.

Mac OS X

On a Mac, use Homebrew:

$ brew install boost --with-python && brew install boost-python

Link: http://brewformulas.org/Boost

This will put all of the boost header files into /usr/local/Cellar/boost/1.63.0/.

Building with Boost

Boost is just header files, so you need to link to them at compile time and #include the right files in your source code.

Links:

Old stuff

Starting With Boost

Boost provides a "Getting Started" guide is a big help for figuring out how to use Boost libraries: http://www.boost.org/doc/libs/1_44_0/more/getting_started/index.html

Basically, Boost provides you with functionality provided primarily through header files. This makes the build process trivial (no compiling - just put the header files somewhere), and it makes the compiling process almost as easy (add a

#include <boost/lambda/lambda.hpp>
</pre

to your code, and then add

<pre>
-I/path/to/boost

to your compile line).

Alternatively, a list of Boost functionality that requires libraries and compilation (a small subset of Boost) is here: http://www.boost.org/doc/libs/1_44_0/more/getting_started/unix-variants.html#header-only-libraries