Boost logo

Boost-Build :

Subject: Re: [Boost-build] Building and Installing Shared Boost Libraries on Windows
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2016-02-08 01:59:37


On 07-Feb-16 8:48 PM, Andrey Sklyar wrote:
> I built boost 1.60.0 as shared libraries (configuration below). A couple of things seem off, but I'm not sure if it's
> me not understanding Windows or if it's something with the Boost build.
> I built the boost library with this configuration:
> .\b2 --build-dir=%BUILD_DIR% architecture=x86 address-model=64 runtime-link=shared threading=multi link=shared variant=debug
> .\b2 headers


> When I tried to link it, it produced an error that it couldn't find
> libboost_filesystem-vc140-mt-gd-1_60.lib
> When I looked at the built artifacts, I saw that the .lib file was actually named
> boost_filesystem-vc140-mt-gd-1_60.lib

The naming is documented at

and it say that the import library for a DLL is "boost_..." whereas a static library is "libboost_...".
Therefore, the libraries that you have are import libraries for a DLL, which is what you seem
to want.

> It seems like, when linking against shared libraries on windows, the linker is looking for link libraries with the "lib"
> prefix, but the Boost build is creating .libs without that prefix. Which should it be?

It seems that when you're building your application, you are not requesting DLL linking. What's your
command line? I think you need to have either /MD or /MDd option on the command line, or select same
under VS project properties (C/C++ -> Code Generation -> Runtime Library)

> **//___^
> I would like to install (aka copy all of the libs, dlls, etc.) both the release and debug versions of the build. What
> would be the right way to tell Boost build to "install the binaries that resulted from the build in %BUILD_DIR%".

Unlike other build systems, install is not special-cased in Boost.Build, so you can just specify desired properties
when building the 'install' target, e.g.:

.\b2 --build-dir=%BUILD_DIR% architecture=x86 address-model=64 runtime-link=shared threading=multi link=shared
variant=debug install

If you have both variant=debug and variant=release on the command-line, then both variants will be built
and installed.


Vladimir Prus

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at