Boost logo

Boost-Build :

From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2008-02-01 14:02:49


  Hi Sandeep.

> Let me rephrase: If the code compiles in visual studio without doing
> anything special (such as explicitly adding system library) then I
> would assume that it should also compile with bjam.

   I've noticed Visual Studio adds some libraries, like those you
mention, automatically to all projects it builds. Whether it deduces
that this should be done by some 'source parsing' or whether it actually
adds them to the list for every project and expects the linker to ignore
them if no actual references to those libraries are made - I do not know.

   However... if your exe, lets call it xxx, needs to be linked to
library advapi32.lib, then tell Boost Build that this is so in your Jamfile.

   E.g.

#-------------------------------

# Declare the advapi32 library... (assuming here it will be found
# by the linker and so am not declaring its search path which would
# otherwise be done using the <search> feature.
lib advapi32lib : : <name>advapi32 ;

# Now build my exe and have it linked with advapi32.
exe xxx : [...your sources here...] advapi32lib ;

#-------------------------------

   And presto... works for all supported compilers/linkers without
hardcoding their specific command-line options.

   Hope this helps.

   Best regards,
     Jurko Gospodnetić


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