Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-04-29 10:41:13


Alexander Grund wrote:
> >> One reason against autolink: It decides the use of static vs dynamic
> >> libraries depending on a preprocessor define, good luck getting that
> >> right in a portable way...
> > The preprocessor define is necessary for things to work, so autolink
> > is correct to decide based on it.
> I am aware of that, I consider that define basically part of the autolink feature.

No, it's not part of the autolink feature. It needs to be set properly whether
or not autolink is used.

This is often overlooked because MSVC works hard to make broken things
work, but there are limits. If you have exported variables and not just
functions (which Boost.Test has), MSVC can't fix that for you. And MinGW
doesn't fix anything for you so there you have to set the macro properly.

Autolink simply turns not setting the macro into a linker error.


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