Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2008-06-25 13:03:40

Why not to introduce an additional level of indirection ;) Just wrap
the 3d-Party lib in a DLL (or Shared Object under Linux), than you
should be find to use 2 libs with each other...

The only point to be careful about if 3d-party lib returns boost class
instances. These might be different in a newer version of the lib.

With Kind Regards,

On Wed, Jun 25, 2008 at 6:41 PM, David Abrahams <dave_at_[hidden]> wrote:
> Vladimir Prus wrote:
>> dariomt_at_[hidden] wrote:
>>> Hi all,
>>> I'm using header-only boost libs in two static libraries that will be linked
>>> into an executable.
>>> No boost components are used in the interfaces of those libs, boost is only
>>> used in the implementation inside the libraries.
>>> Is it possible to mix versions of boost in those two static libraries? Will
>>> the linker complain, or will it just get confused and mess up the
>>> executable?
>> In general, this is highly risky business. On GCC, each static library
>> will contain a copy of every template function used by a static library.
>> If the linker finds that the same function is used in both static libraries,
>> it will put only one copy in the output executable, and if the definitions
>> of those functions differ, you're in trouble. See the attached example, which,
>> then run, produces:
>> a.cpp:say
>> a.cpp:say
>> Which is clearly wrong. This *might* work with shared libraries, but you
>> need to consult your toolchain documentation.
> For the past few years we've had a GCC option that allows you to expose
> from dynamic libs only those names you specify, sort of like declspec on
> Windows. I don't remember the name of the flag, though.
> --
> Dave Abrahams
> BoostPro Computing
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at