Boost logo

Boost :

From: Gavin Lambert (boost_at_[hidden])
Date: 2021-06-10 23:23:46


On 8/06/2021 7:42 pm, I wrote:
> Another way of putting all this is that libraries that can be configured
> between static/shared are mostly fine these days, because the tools have
> some blunt hammers that mostly do the right things with them.  (But
> still bite people on occasion.)

FWIW, the most common biting issue is when mixing static/shared.

All-static and all-shared are usually pretty safe.

But when libraries A and B both use dependency C, and either of A and B
is shared, then C must be shared as well -- things will often break
horribly if C is static.

(Having said that, what actually happens is highly dependent on whether
using Windows or something UNIXy, and for the latter what symbol
visibility level is being used. And for some libraries and some
platforms/settings then there will be no apparent problems.)

But this sort of thing is usually why tools like CMake prefer to offer
global settings to configure static/shared rather than letting it be
configured on a target-by-target basis. You *can* override that, but it
is at your own peril. (Or that of the downstream app.)


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