Boost logo

Boost-Build :

Subject: Re: [Boost-build] [documnetation error?] linking with a prebuilt library
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2010-06-18 05:23:38


Johan Nilsson skrev:
> Thorsten Ottosen wrote:
>> Dear all,
>>
>> I was trying to link with a prebuilt library. But somehow the file is
>> not passed correctly on to the compiler. I looked at
>>
>> http://www.boost.org/doc/tools/build/doc/html/bbv2/tasks/libraries.html
>>
>> which states I can do something like
>>
>> lib a : : <variant>release <file>/pool/release/a.so ;
>> lib a : : <variant>debug <file>/pool/debug/a.so ;
>>
>> but this doesn't work.
>
> How?
>
>> I have to say
>>
>> lib a : : <variant>release:<file>/pool/release/a.so ;
>> lib a : : <variant>debug:<file>/pool/debug/a.so ;
>>
>> Could this be an error in the documentation?

Hm. You're right. It seems like no linking takes place with my style.

So here's what I got (I am on windows):

local CODE_ROOT = [ os.environ CODE_ROOT ] ;

lib hugin : : <variant>release
<file>$(CODE_ROOT)/dependencies/hugin/Lib/hugin-7.1-vc9.lib ;
lib hugin : : <variant>debug
<file>$(CODE_ROOT)/dependencies/hugin/Lib/hugin-7.1-vc9d.lib ;

# ...

[ unit-test speed_of_propagation
              : speed_of_propagation.cpp bayesian hugin
                                     ]

This causes bjam to link with a file named "hugin.lib". The bjam output
list this file in the files sent to the linker. That's wierd IMO.

I tried replacing the file paths to the exact paths (that is, not using
the $(CODE_PATH) prefix).

Then it worked.

Maybe, just a suggestion, we could emit an error message if the file is
not found in a <file> directive.

Thanks for the help

Thorsten

-Thorsten


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