Boost logo

Boost Users :

Subject: [Boost-users] When to use BOOST_ALL_DYN_LINK?
From: Florian Lindner (mailinglists_at_[hidden])
Date: 2016-10-24 04:43:11

Hello, says:

If defined in user code, the library will assume the binary is built as a dynamically loaded library ("dll" or "so").
Otherwise it is assumed that the library is built in static mode. This macro must be either defined or not defined for
all translation units of user application that uses logging. This macro can help with auto-linking on platforms that
support it.

Same as BOOST_LOG_DYN_LINK but also affects other Boost libraries the same way.

We build our library in a dynamic and a static version using SCons:

staticlib = env.StaticLibrary (
    target = buildpath + '/libprecice',
    source = [sourcesPreCICE]
env.Alias("staticlib", staticlib)

solib = env.SharedLibrary (
    target = buildpath + '/libprecice',
    source = [sourcesPreCICE]
env.Alias("solib", solib)

Both have BOOST_LOG_DYN_LINK set:


However, I wonder if this is correct. Should DYN_LINK only be set when building the dynamically linked lib?


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