From charlesreid1

No edit summary
No edit summary
Line 3: Line 3:
http://www.boost.org/
http://www.boost.org/


=Starting With Boost=
=Installing=


Their "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
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]]:
 
<pre>
$ brew install boost --with-python && brew install boost-python
</pre>
 
Link: http://brewformulas.org/Boost
 
This will put all of the boost header files into <code>/usr/local/Cellar/boost/1.63.0/</code>.
 
=Building with Boost=
 
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
 
 
 
 
=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
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


<syntaxhighlight lang="cpp">
<pre>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/lambda.hpp>
</syntaxhighlight>
</pre


to your code, and then add
to your code, and then add


<syntaxhighlight lang="bash">
<pre>
-I/path/to/boost
-I/path/to/boost
</syntaxhighlight>
</pre>


to your compile line).
to your compile line).
Line 28: Line 55:


[[Category:C++]]
[[Category:C++]]
[[Category:Cpp]]
[[Category:Boost]]

Revision as of 00:24, 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.

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



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