Oh Boost is Boost and Xcode is Xcode and never the twain shall meet

I love the Boost library.  It is without a doubt one of the most important libraries for C++ development.  I use it in practically every program I write.

Right now, I’m working on a Mac, and I wanted to use Xcode for my programming.  Sounds reasonable, really.  It is the Apple tool for it, and since it uses the GCC tools under the hood, I am familiar with error messages and such, so it should be straightforward to use.

It isn’t!

I find it practically impossible to link with Boost.

I’ve installed Boost using the “port” tool, so it is installed the way it would be on e.g. a Linux machine.  That means that the header files are found in /usr/local/include and the libraries in /usr/local/lib.

Setting the path to the header files in Xcode isn’t so much of a problem, but getting it to link with the right library is beyond me.

As far as I’ve figured out, you need to add the right .a file.  Doing this is not so easy, ’cause the GUI won’t let you find /usr/ unless you do a bit of magic to unhide that directory.  If you manage to add the library, at least this is how it works for me, you can build the Release but not the Debug target, and even though you added a .a file, it will link with the corresponding .dynlib file, so you cannot distribute the compiled file without requireing people to have Boost installed.

How does it suck? Let me count the ways…