Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2007-05-17 15:52:13


"David Abrahams" <dave_at_[hidden]> wrote in message
news:871whgeltf.fsf_at_grogan.peloton...
>
> on Tue May 15 2007, Douglas Gregor <doug.gregor-AT-gmail.com> wrote:
>
>> Users of Boost.Build are isolated from this change are isolated from
>> the effects of this change due to usage-requirements. usage-
>> requirements are very cool, but they hide the fact that this change
>> causes real trouble for people not using Boost.Build. The very simple
>> line
>>
>> g++ mytest.cpp -I $BOOST_HDRDIR -L $BOOST_ROOT/lib -
>> lboost_unit_test_framework-gcc33-mt-d
>>
>> fails to link. That's bad for at least two reasons: (1) it's the
>> first line that someone is likely to write when trying out the unit
>> test framework, and it's not going to work; (2) it's the line that
>> most non-BBv2 build systems would produce, because using -L and -l
>> are the common ways to link against a static library in the Unix
>> world. Not the *only* way, but the common way. There also doesn't
>> seem to be any documentation that tells users that this change was
>> made, or how to link to the Boost unit test framework on a *nix system.
>
> (3) It's what the getting started guide tells users to do.

And it will work for trivial test presented by the user:

#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(mytest)
{
}

with a single change to add one define BOOST_TEST_DYN_LINK or in original
version

#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(mytest)
{
}

if we somehow make Boost.Build to produce different names for static and
dynamic libraries.

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk