The Software Purist |

Nov/09

23

Boost 1.41.0

I was very excited when I noticed that the C++ Boost library has a new release which just came out, Boost 1.41.0.  Going through the release notes, there are some significant bug fixes in some of the libraries I use.  In addition, there is a new library called Property Tree.  This seems like a simple, but very useful concept for storing different types of property and configuration data.  I am already considering using it on a project I’m working on.  I like that it supports both XML and JSON.  This is a bonus for me, because both protocols are so widely used and have their own benefits and drawbacks, I like to support both whenever possible.  You can check out the “Five Minute Tutorial” here: Boost.PropertyTree Tutorial.

While we’re at it, it’s a good time to give a quick overview of the magic boost building incantation I use. Boost has their own building system called Bjam, which you will need to download. Unfortunately, Boost Build has it’s own proprietary building system, which is generally only useful for Boost projects, and so, it’s usually worth only learning the bare minimum to build, unless you’re planning on making your own Boost-style library, or possibly making heavy edits to a Boost distribution (which I generally discourage). Here is the line I use to build:

bjam –toolset=msvc-9.0 –build-type=complete stage

This, of course, builds everything. This may be more than what you need, and so things can be tweaked as needed, by changing the build type or adding additional flags. You can change the compiler version by changing the toolset (e.g.: msvc-8.0 will build Visual Studio 2005). Additionally, certain libraries are not built, unless you set additional environment variables beforehand, to indicate you want to build them. As a quick example, if you need ZLIB support, you have to set the ZLIB_BINARY, ZLIB_INCLUDE and ZLIB_LIBPATH environment variables before executing. I usually gather all the options I want and then make a batch file, which I check into source control, so that I can always repeat this build process.

You can get the new Boost release here: Boost

· · · · ·

No comments yet.

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me