Boost logo

Boost Users :

Subject: [Boost-users] Boost.Locale on Windows not building with runtime-link=static
From: Thomas Ziegenhagen (thomas_at_[hidden])
Date: 2015-09-18 07:59:05


Hello there,

once every year or so I have to rebuilt boost for the current
compiler/settings combination I work with. This time it's the following:

Visual Studio 2015
32 and 64bit
static linking
statically linked runtime

I built boost from within the VS2015 developer console using this command
line:

c:\projects\boost_1_59_0>.\b2 variant=debug,release link=static
runtime-link=static address-model=32 --stagedir=stage32
-sICU_PATH=C:\projects\icu

Works great. Except that Boost.Locale does not respect the
"runtime-link=static" and builds for dynamically linked runtime instead.
The build log looks like this:

...patience...
...found 19297 targets...
...updating 76 targets...
common.mkdir stage32
common.mkdir stage32\lib
common.copy stage32\lib\libboost_atomic-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_system-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_chrono-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_container-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_thread-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_context-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_coroutine-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_date_time-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_exception-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_filesystem-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_regex-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_graph-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_iostreams-vc140-mt-sgd-1_59.lib
common.copy stage32\lib\libboost_system-vc140-mt-gd-1_59.lib
common.copy stage32\lib\libboost_chrono-vc140-mt-gd-1_59.lib
common.copy stage32\lib\libboost_thread-vc140-mt-gd-1_59.lib
common.copy stage32\lib\libboost_locale-vc140-mt-gd-1_59.lib
common.copy stage32\lib\libboost_log-vc140-mt-sgd-1_59.lib

Shortened. Please note the build process working correctly up until
iostreams - all libraries have a 's' in the filename, denoting the
statically linked runtime. Then comes Boost.Locale. And Boost.Locale does
not respect the static runtime linking and instead builds for DLL runtime.
The build process therefore builds all dependencies (system, chrono,
thread) again with dynamic runtime linking and then builds Boost.Locale.

When I'm trying to use this setup in my game, the boost auto-linking
mechanism correctly determines that Boost.Locale is required, but requires
the static runtime linked version, which obviously doesn't exist.

So this is a bug in the build files? Is there a simple quickfix I can
apply to my local installation to be able to carry on? Should I open an
issue in Trac?

Thanks for your time.

Bye, Thomas


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