List Info

Thread: Link to a library in /home/chris/lib that has already been compiled




Link to a library in /home/chris/lib that has already been compiled
country flaguser name
United States
2007-08-03 18:21:02
Hello,

With gcc, I link to a library that has already been
compiled by passing this to gcc:
  -L /home/chris/lib -lmylib

How do I do this with Boost.Build V2?

Chris




       
____________________________________________________________
________________________
Be a better Heartthrob. Get better relationship answers from
someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=3965454
33
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Link to a library in /home/chris/lib that has already been compiled
user name
2007-08-03 23:35:35
Chris Stankevitz wrote:

> Hello,
> 
> With gcc, I link to a library that has already been
> compiled by passing this to gcc:
>   -L /home/chris/lib -lmylib
> 
> How do I do this with Boost.Build V2?

Is there a reason why the second example in

        http://boost.org/boost-build2/doc/html/bbv2/task
s/libraries.html

does not work for you?

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Link to a library in /home/chris/lib that has already been compiled
country flaguser name
United States
2007-08-07 18:47:24
On Sat, 04 Aug 2007 08:35:35 +0400, Vladimir Prus wrote:

> Chris Stankevitz wrote:
> 
>> Hello,
>> 
>> With gcc, I link to a library that has already been
compiled by passing
>> this to gcc:
>>   -L /home/chris/lib -lmylib
>> 
>> How do I do this with Boost.Build V2?
> 
> Is there a reason why the second example in
> 
>         http://boost.org/boost-build2/doc/html/bbv2/task
s/libraries.html
> 
> does not work for you?
> 
> - Volodya

Actually, this is NOT working for me.  Boost.Build seems to
add the -l 
arguments, but not the -L arguments when I use
<search>.

Here is my Jamfile:

lib uuid ;
lib tinyxml : : <name>tinyxml
<search>$(TINYXML_ROOT) ;
lib boost_filesystem : :
<name>boost_filesystem-gcc41-mt <search>
$(BOOST_ROOT)/stage/lib ;
lib boost_system : : <name>boost_system-gcc41-mt
<search>$(BOOST_ROOT)/
stage/lib ;
lib boost_thread : : <name>boost_thread-gcc41-mt
<search>$(BOOST_ROOT)/
stage/lib ;
exe hard_coded
        : hard_coded.cpp /mantra/core/log//log
          uuid tinyxml boost_filesystem boost_system
boost_thread
        : <include>$(TINYXML_ROOT) ;


For completeness, here is my Jamroot:

import os ;

path-constant MANTRA_ROOT : . ;
local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
local TINYXML_ROOT = [ os.environ TINYXML_ROOT ] ;

project
        : requirements <include>.
<include>$(BOOST_ROOT)
        ;

use-project /mantra/core/log : libs/core/log ;
use-project /mantra/utils/throttler : libs/utils/throttler
;


By rights it SHOULD generate -L arguments, but the g++ link
argument has 
no -L flags in it at all.  The -l arguments are all there,
but no -L 
arguments.  I set BOOST_ROOT to $HOME/src/boost and
TINYXML_ROOT to $HOME/
src/tinyxml, which gets imported above, and since the
compiles work I 
know that is fine.

PreZ

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Link to a library in /home/chris/lib that has already been compiled
user name
2007-08-08 03:16:04
Preston A. Elder wrote:

> For completeness, here is my Jamroot:
> 
> import os ;
> 
> path-constant MANTRA_ROOT : . ;
> local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
> local TINYXML_ROOT = [ os.environ TINYXML_ROOT ] ;

This defines BOOST_ROOT variable in Jamroot.

> Here is my Jamfile:
> 
> lib uuid ;
> lib tinyxml : : <name>tinyxml
<search>$(TINYXML_ROOT) ;
> lib boost_filesystem : :
<name>boost_filesystem-gcc41-mt <search>
> $(BOOST_ROOT)/stage/lib ;
> lib boost_system : : <name>boost_system-gcc41-mt
<search>$(BOOST_ROOT)/
> stage/lib ;

This tries to make use of BOOST_ROOT variable, in Jamfile.
However, nothing
in the code you posted sets BOOST_ROOT variable *in Jamfile*
to any value.

The value of BOOST_ROOT in Jamroot -- which is a completely
different file --
is independent.

I'd suggest

        path-constant BOOST_ROOT : [ os.environ BOOST_ROOT ]
;

in your Jamroot.

> By rights it SHOULD generate -L arguments, but the g++
link argument has
> no -L flags in it at all.  The -l arguments are all
there, but no -L
> arguments.  I set BOOST_ROOT to $HOME/src/boost and
TINYXML_ROOT to $HOME/
> src/tinyxml, which gets imported above, and since the
compiles work I
> know that is fine.

Either headers from standard location are picked, or you did
not include something.
Can you please post a complete example as archive?

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Link to a library in /home/chris/lib that has already been compiled
country flaguser name
United States
2007-08-08 13:31:42
On Wed, 08 Aug 2007 12:16:04 +0400, Vladimir Prus wrote:

> I'd suggest
> 
>         path-constant BOOST_ROOT : [ os.environ
BOOST_ROOT ] ;
> 
> in your Jamroot.

That worked a treat, thanks 

PreZ 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )