Boost: Difference between revisions
From charlesreid1
No edit summary |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Boost is | 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/ | 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]]: | |||
<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. | |||
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= | |||
==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 | |||
<pre> | |||
#include <boost/lambda/lambda.hpp> | #include <boost/lambda/lambda.hpp> | ||
</ | </pre | ||
to your code, and then add | to your code, and then add | ||
< | <pre> | ||
-I/path/to/boost | -I/path/to/boost | ||
</ | </pre> | ||
to your compile line). | to your compile line). | ||
| Line 23: | Line 52: | ||
{{Programs}} | |||
[[Category:C++]] | |||
[[Category: | [[Category:Cpp]] | ||
[[Category: | [[Category:Boost]] | ||
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++.
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:
- 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
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