tags:

views:

166

answers:

2

Hello,

I'm trying to build the boost libraries and others against the os x 10.4u.sdk so I can include them in a project targeting 10.4 upwards.

I'm not entirely sure what to do, am I aiming to put the .dylibs in 10.4.sdk/usr/local/.. or in my default 10.6 /usr/local/.. with support for 10.4?

Any help much appreciated.

Toby.

A: 

You need to distribute your libraries to the users, so it doesn't help installing them into your machiine's /usr/local. It's better to just set the linker search path to whatever directory you have the library.

When you distribute an app, you're supposed to put every libraries you use inside the .app bundle (unless you're making a series of apps which share a lot of codes) so that users don't need any installer. So, there's not much to be gained by using the dynamically linked libraries, especially for non-GUI ones like boost. So I would recommend you to make a static library .a and statically link against it.

If you're curious, you can find how to include frameworks in your app here in the SO question.

Yuji
+1  A: 

I don't use a mac, but here's the info i know, combined with the information i gathered on the web. The first thing to know is that most boost libraries do not require any compiled binaries. But i am guessing you know that and want to use other libraries, such as datetime or regex.

To compile boost libraries, the official way is to use a tool named bjam. Download it there (Latest link may be found there).

The command line to use to compile boost libraries using bjam is shown in the following link.

bjam --toolset=darwin --build-type=complete --with-thread 
    --with-date_time --with-filesystem 
    --with-regex --with-system architecture=combined

UNTESTED (by me), but all the sources i found suggest this is the right approach.

Benoît