Question

I'm trying to find instructions on how to install Boost libraries with codeblocks on a Mac. Specifically I just need to use the Boost Spirit library. The CodeBlocks webpage gives instructions for Windows at http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef. I've been trying to find similar instructions for a Mac but have not been able to do so. Does anybody have pointers?

Was it helpful?

Solution

From the documentation Structure / Include (directly after the introduction):

Spirit is a header file only library. There are no libraries to link to

This indeed means you only need to indicate the location of the headers, and you're good to go.

  1. download the current version (via http://www.boost.org/)
  2. extract
  3. add to include path

Note that the same goes for all the requisites from Boost: Phoenix, Proto, Fusion, Mpl, Typetraits, Utility are all header-only

Finally, you can create a subset of boost that matches what you use. E.g. to 'excise' the subset for

 #include <boost/spirit/include/qi.hpp>
 #include <boost/spirit/include/phoenix.hpp>

on my system I could do

~/custom/boost/bin.v2/tools/bcp/gcc-4.7/release/link-static/bcp \
     --boost=/home/sehe/custom/boost --scan ./test.cpp outdir/

which results in 2757 files (totalling ~1.1MiB when bzip2 compressed)

OTHER TIPS

I do not know much about spirit, but it looks for me as if you can simply put the files in your include directory... (as I did it with the whole boost librarys on my windows machine)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top