Boost logo

Boost-Build :

Subject: [Boost-build] best was to handle external libs on windows and unix
From: Jim Gallagher (jim_at_[hidden])
Date: 2009-03-31 16:37:25


We are using boost-build as a build environment around customizations to a
COTS product. We extend the product using C/C++; the vendor supplies header
files and libraries with the product. The vendor libraries are named the
same on windows and unix, except for the platform conventions. For example,
on windows we may link against libfoo.lib, while on unix we link against

The problem is that the linker behaves differently with respect to passed
library names between windows and unix. For example, if I define libfoo like

lib libfoo : : <name>foo <search>$(VEND_ROOT)/lib ;

Then the link works on unix, as the linker gets passed -lfoo, and it assumes
that there is a lib prefix. This does not work on windows, because there is
no prefix assumption. The linker gets passed foo.lib, which fails because
the name is really libfoo.lib.

If I leave the name property off, then the link works on windows but fails
on unix, because -llibfoo tells the linker to look for, which
is, of course, wrong.

Any suggestions on the best way to handle this? I have ~300 vendor libs to
deal with....

Jim Gallagher

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