Boost logo

Boost-Build :

Subject: Re: [Boost-build] build of shared libs not producing .lib file.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-09-22 00:01:31


AMDG

Bob Walters wrote:
> Having difficulty using Boost.Build (1_39_0 with bjam 3.1.17
> downloaded binary) to build a pair of libraries in 2 projects with one
> depending on the other. The first library, 'stldb' depends on 5 boost
> libraries. The second library stldb-jni depends on stldb, and thus
> indirectly on boost. The stldb-jni library is loaded via the Java
> native interface, and thus must be built as a shared library, while
> the stldb library has no compulsion either way. The problem I'm
> having is specific to Windows - no problem at all on Linux w/ various
> flavors of gcc.
>
> The problem is that when the stldb.dll is built, there is no
> corresponding stldb.lib built, which seems to be what the subsequent
> build is trying to link with.
>
> <snip>
>
> What I can't figure out is how to get the .lib file that you normally
> see alongside the boost DLLs in stage/lib after a successful boost
> installation. i.e. The files that facilitate linking with the DLL
> that has been built.
>

You need to use __declspec(dllexport) on windows.
MSVC only generates an import library if there
are exported functions.

> When I try to build the subsequent library without the .lib, it tries
> linking dynamically, and yields the predictable error:
>
> LINK : fatal error LNK1181: cannot open input file
> 'C:\workspaces\stldb_head\stldb_lib\bin\msvc-9.0\debug\threading-multi\stldb.lib'
>
> I've tried getting the later library to link statically by changing
> the library reference to "/stldb_lib//stldb/<link>static", I get rid
> of that error, but start getting:
>
> LINK : fatal error LNK1104: cannot open file
> 'boost_date_time-vc90-mt-gd-1_39.lib'
>

You probably need <define>BOOST_ALL_NO_LIB

In Christ,
Steven Watanabe


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk