Boost logo

Boost Users :

Subject: Re: [Boost-users] statically linked boost libs with VS2010 missing ?
From: Lars Viklund (zao_at_[hidden])
Date: 2012-08-08 19:34:56


On Wed, Aug 08, 2012 at 08:29:27AM -0800, Robert Ramey wrote:
> Lars Viklund wrote:
> > On Wed, Aug 08, 2012 at 10:21:41AM +1000, trevor_at_[hidden] wrote:
>
> >> Is this some MSVC toolchain issue ? Is there another option I need
> >> to be using for this toolchain ?
> >
> > link=static makes static-linked Boost libraries (lib- prefix)
> >
> > runtime-link=static makes libraries linked against
> > the static runtime (-s-).
> >
> > Your use case probably wants both static link and runtime-link, as
> > dynamic linking a Boost that uses a static runtime is pretty much
> > always a bad thing.
>
> This requires a little more clarification somewhere.
>
> It's true that creating a DLL which uses static linking can
> cause problems and avoiding doing this will avoid them.
> But, sometimes it's necessary. It's not clear what the rules
> are that would permit one to do this without problems.
>
> Robert Ramey

The set of circumstances where this is valid is very narrow.

In essence, if you have a statically linked runtime, allocations and
deallocations must be done in the same module, you cannot pass standard
library types (both std::whatever<T> and things like FILE*) across the
module boundary.

In essence, unless you use something that is completely independent of
both allocation, I/O and standard library types, you're very likely to
blow up.

You pretty much need a proper plugin-style interface for anything like
that to remotely have a chance of succeeding. I don't see any part of
Boost designed to work like that.

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net