Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-04-10 02:35:15


On Sunday 09 April 2006 23:19, King, Steven R wrote:

> # symbolic name of this code
> # and common requirements
> project ctllib
>
> : requirements <include>$(SW_ROOT)/lib
>
> ;
>
> lib ctllib
>
> : # sources
>
> src/qlist.c
>
> : # requirements
> : # default build
> : # usage-requirement
>
> <include>.
> ;

By default, V2 builds all libraries as shared, both on Linux and Windows. On
Linux, shared libraries just work. On Windows, you need to add some
__dllexport attributes to functions/classes defined in qlist.c, otherwise no
symbol will be exported and msvc linker will bypass generating of import
library (the one with .lib suffix).

I suspect you already know this, but your Jamfile does not have the setup
necessary for dynamic linking on Windows. Typycally, you'll put:

  <link>shared:<define>CTLLIB_SHARED=1

to your requirements, and use some macros in your headers to make sure
__dllexport/__dllimport are set up properly when CTLLIB_SHARED is set to 1.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2

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