Boost logo

Boost-Build :

Subject: Re: [Boost-build] Shared library as usage-requirement
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-07 17:32:23


AMDG

Younes Manton wrote:
> Steven Watanabe <watanabesj <at> gmail.com> writes:
>
>> Does boost_iostreams work if you try to use it directly in an executable
>
> Yes, I can link with boost_iostreams if I include it in the Jamfile of the
> executables that are also linking with libkar.

How about if you create an executable in the same Jamfile
as libkar. I'd like to be sure that the problem is not caused
by some subtle difference between the targets.

> The problem is I have to do this
> for every executable. I want all depedents of libkar to link with boost_iostream
> as a requirement, just like they have to include the libkar dir, but I can't get
> that to work at the moment.
>

I can't reproduce your problem. Both of your attempts ought to work,
although listing boost_iostreams as a source is more correct.
What version of Boost.Build are you using?

Can you post the output of
  bjam -n
on a minimal project that demonstrates the problem?

For instance, in this project (with a dummy test.cpp)

# Project attributes
project
    : usage-requirements <include>.
    ;

# Project targets
lib libkar : archive.cpp archive_file.cpp boost_iostreams : <link>static ;

searched-lib boost_iostreams
    :
    : <name>boost_iostreams-gcc43-mt
    ;

exe test : test.cpp libkar ;

the link command looks like:

    "g++-4.3.0" -o "bin\gcc-4.3.0\debug\test.exe" -Wl,--start-group
"bin\gcc-
4.3.0\debug\test.o" "bin\gcc-4.3.0\debug\link-static\libkar.lib"
-Wl,-Bstatic -
lboost_iostreams-gcc43-mt -Wl,-Bdynamic -Wl,--end-group -g

In Christ,
Steven Watanabe


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