Boost logo

Boost-Build :

Subject: [Boost-build] [boost-build] link=shared with msvc does not propagate dependent libraries
From: Richard G G (glanmark_at_[hidden])
Date: 2010-05-10 04:56:02


Compiling my project with bjam on Windows/msvc toolset works fine as long as
use static linking like:

> bjam link=static

However, invoking bjam with link=shared, I get undefined symbols.

It seems as if dependent libraries are not propagated with shared linking,
but with static linking!?

Basically I have the following:

 /
   | Jamroot
   |
   +-- dirA
   | Jamfile
   |
   +-- dirB
         | Jamfile
         |
         +-- test
                 Jamfile

Jamroot:
 use-project /boost : {path-to-boost-installation} ;

/dirA/Jamfile:

  lib a : sourceA.cpp ;

/dirB/Jamfile:

  project B : <library>/dirA//a
  lib b : sourceB.cpp ;

/dirB/test/Jamfile:

  project BTest : <library>/dirB//b ;

  unit-test testB : sourceBTest.cpp ;

When compiling the unit test with link=static, everything works fine. But
with link=shared, I get undefined symbols from lib a. When analyzing the
boost build with -d2, static linking propagates its dependent libraries,
i.e. library a is present when linking the unit test. But its not propagated
with link=shared.

Why?

Adding library a explicitly in the requirements for project BTest will make
it work with link=shared. But isn't this unnecessary and the point of
propagating dependent libraries?

Thanks,

Richard

-- 
View this message in context: http://old.nabble.com/-boost-build--link%3Dshared-with-msvc-does-not-propagate-dependent-libraries-tp28473811p28473811.html
Sent from the Boost - Build mailing list archive at Nabble.com.

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk