Boost logo

Boost-Build :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-07-11 10:21:26


Vladimir Prus wrote:
>
> Markus Schöpflin wrote:
> > Hello,
> >
> > what's the officially supported way of linking a boost library
> > with an external project that uses boost::build?
> >
> > Say I have my own project foo that wants to link to the boost
> > thread library. I have set up everything so that I can compile
> > the project but I can't see how to link to the thread lib.
> >
> > For example:
> >
> > exe foo : foo.cpp : <sysinclude>$(BOOST_ROOT) ;
> >
> > I tried to add
> > <find-library>$(BOOST_ROOT)/libs/thread/build/boost_thread
> > hoping that bjam would find the right thread lib on it's own
> > but that doesn't work as it just adds -l<...>/build/boost_thread
> > to the linker command line not taking into account the variants.
>
> Yes... that's what it does. To link with a library you'd need to use
> <library-file>feature. Here's an example:
>
> exe a : a.cpp : <library-file>b.a ;
>
> The problem, is that you have to specify *exact* name to the library. That
> is, you can't use different variants (debug/release) of it.

Well, I think I can work around that by saying
<gcc><my-debug><library-file>$(BOOST_ROOT)/.../my-debug/libboost_thread.a
<gcc><my-release><library-file>$(BOOST_ROOT)/.../my-debug/libboost_thread.a

Not pretty, but it should work.

>
> > Next I tried to add
> > <lib>$(BOOST_ROOT)/libs/thread/build/boost_thread to the
> > sources but this doesn't work either because bjam doesn't
> > find threads.jam which is included from the Jamfile in the
> > thread build directory.
>
> I'm afraid that never worked. In fact, smooth project interaction is one of
> my personal motivations for V2 and the good news is that using targets across
> different projects already works there :-)

More power to you! (and Dave and Rene and everyone else working on V2,
of course) :-)

>
> - Volodya

Thanks, Markus

 


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