Search code examples
c++dynamicbooststaticboost-log

Can Boost Log be built as a .dll/.so in a static Boost build?


Is it possible to build Boost Log as a dynamic library (.dll/.so), but do so within a static Boost build? I'd like all the other Boost libraries to be static, and only Boost Log as a .dll (because several .dlls use it within the same application).

Do all the Boost libraries need to be dynamic to get a Boost Log .dll? I've tried to add define=BOOST_LOG_DYN_LINK to my bjam command line, to no avail:

bjam --toolset=msvc-10.0 address-model=64 variant=release,debug link=static threading=multi runtime-link=static define=BOOST_LOG_DYN_LINK

Solution

  • You can narrow the scope of the build by specifying only the library you want to build using the --with-<library> switch, eg.,

    ./bjam link=shared --with-log ...