Boost Users :
From: Scott Lamb (slamb_at_[hidden])
Date: 2004-01-13 17:50:03
Sebastian Orfino wrote:
> I am having problems too trying to build the threads lib, and it fails due
> to an unrecognized -shared option passed to the linker and as far as i can
> see, there is no a thread static library. Then I ran bjam "-sTools=darwin
> cwpro8" in the boost root directory and i only got static library builds.
> All the dynamic library builds failed due to this -shared option passed to
> the linker. So what is the flag that the build system should use instead of
> -shared ?
I've run into this same problem. I haven't bothered to get it to build
the dynamic libs, but maybe this info will help:
On OS X, things are a bit different than the rest of the world. It has
three different kinds of libraries to Linux's two:
A static library is a ".a", just as under Linux.
On Linux, a dynamic library is a ".so". On OS X, there are two different
- A dynamic _linking_ library (the kind you probably want here) is a
.dylib. (The kind you can link to with -lboost_XXX.) I think you want
"-dynamiclib" instead of "-shared" to make one of these.
- A dynamic _loading_ library (for modules loaded through dlopen() and
friends) is a .so. (I'm not sure if any part of boost uses these or not.)
Plus, libraries can be packaged into bundles or frameworks. There's a
specific directory structure for those, and the rpath needs to be set up
in a specific (weird) way...something like ../@executable_name IIRC.
That's the most "OS X"y way to do things, I guess.
Also, you specify the rpath a little differently. Under Linux, you'd
specify it to the gcc link stage with -Wl,--rpath=blah ("-Wl," being an
argument that passes an argument through to ld.) Under OS X, you'd
specify it with --rpath=blah (no "-Wl,"; the rpath argument being to gcc
itself, not to ld.)
Also, apparently there's a boost-build mailing list (or similar; I've
forgotten the exact name) for the boost jam build tool. You probably
would have better luck asking about this there.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net