Boost logo

Boost-Build :

Subject: Re: [Boost-build] Dependency on shared library from staticlibrary(mixing shared and static libs)
From: Alexander Sack (pisymbol_at_[hidden])
Date: 2009-02-04 10:08:44

On Wed, Feb 4, 2009 at 9:35 AM, Johan Nilsson <r.johan.nilsson_at_[hidden]> wrote:
>>> Well, obviously a static lib can't be linked (at least not with msvc).
>>> Hence
>>> the "... _reference_ the shared build of a" (which could be even more
>>> specific by stating "contains references to the functions exported by the
>>> shared build of a", perhaps).

At least with gcc toolchain that worked fine for me.

>> Do you still have the issue though?
> Yes. Your suggested solution generates both shared and static versions of
> "a", and passes both as linker inputs for msvc. See below for relevant part
> of output using "bjam -d+2"

Yes that's true too for gcc. However the final binary is c is
depedent on the shared library a which is what you want. The rule you
gave makes liba shared when the main target is always built as per:

Other than the fact that bjam builds both versions of the library, I
guess I fail to see the real issue (at least with gcc since I have not
tried msvc). If you build with link=static you get a static binary
and static libraries, if you build link=shared, you get a static libb,
a shared liba, and c exe/binary that has symbols linked in from static
archive and depends on shared library.

Sorry if I misunderstood...I'll let others chime in....perhaps there
is a cleaner way to do this...


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at