The include requirement works, but linkerflags "have non-free properties"
(whatever that means).
I think it means <linkflags> is the preffered spelling for <linkerflags> :D
But your <library-path> choice is even better.
On Mon, Jul 7, 2008 at 11:21 PM, <t3@spudsoft.co.uk> wrote:
> Thanks, but I can't do it in my Jamroot file because I need that to work
> across all four different platforms.
>
> What I've got at the moment almost works, except for specifying my libpath.
> As I understand it for Linux I want to list each individual library I use,
> whereas for Windows I can just provide the search path and the auto linking
> will take care of it.
>
> Jamroot:
> exe mything :
> main.cpp
> /boost//program_options
> ;
>
> site-config.jam (32bit Windows):
> project boost : ;
> alias program_options : : ;
>
> That works because on the 32 bit Windows I can add my header and library
> path to environment variables.
> Unfortunately on 64 bit Windows I need to be able to compile for both 64bit
> and 32bit, so I can't use environment variables and need boost build to take
> care of it.
> I've been trying with:
>
> site-config.jam (64bit Windows):
> project boost :
> usage-requirements
> <include>"C:\\Program Files
> (x86)\\Boost\\include\\boost-1_35"
> <linkerflags>"/LIBPATH:C:\\Program Files (x86)\\Boost\\lib"
> ;
> alias program_options
> : # no sources
> : # no build requirements
> : # no default build
> : # no additional usage requirements
> ;
>
> The include requirement works, but linkerflags "have non-free properties"
> (whatever that means).
> Also, obviously, I need to put conditions on that search path (address-space
> 32 and 64), which I don't think is going to work :)
>
> I'm also not at all clear whether I can have "project boost" in site-config
> without precluding having other projects in there, but I'm assuming I can
> move it to its own file if I have to.
>
> Thanks again.
>
> Jim
>
>
>
> -----Original Message-----
> From: boost-build-bounces@lists.boost.org
> [mailto:boost-build-bounces@lists.boost.org] On Behalf Of Guido Ziliotti
> Sent: 07 July 2008 08:01
> To: Boost.Build developer's and user's list
> Subject: Re: [Boost-build] How to link in boost libraries using boost-build?
>
> You may found some help searching for "My troubles when compiling
> without link=static. (with msvc-8.0)" and its replies.
>
> My favourite way to get the job done is outlined, anyway here it
> follows. It's window specific but easy enough to be translated with
> minimal effort.
>
> 1) I' m assuming you have already built the static or shared libs you
> need. In case you have not then the line
>
> bjam --build-type=complete install
>
> will give you what you need (and some more possibly).
>
> Then you just need a Jamroot file such as
> # Jamroot contet follows #
> path-constant BOOST_INSTALLED_LIB : C:/Boost/lib ;
> path-constant BOOST_INSTALLED_INC : C:/Boost/include/boost-1_35 ;
> path-constant BOOST_ROOT : C:/guido/env/boost/boost_1_35_0 ;
> use-project /boost : $(BOOST_ROOT) ;
> project
> : requirements <include>$(BOOST_INSTALLED_INC)
> <linkflags>/LIBPATH:$(BOOST_INSTALLED_LIB)
> ;
>
> exe bob : main.cpp ;
> # this should be enough
>
> # part of my previous post you may like to look at
> # exe first : first.cpp ;
> # exe options_description : options_description.cpp ;
> # exe multiple_sources : multiple_sources.cpp ;
> # exe custom_syntax : custom_syntax.cpp ;
> # exe real : real.cpp ;
> # exe regex : regex.cpp /boost/regex//boost_regex ;
>
> # Jamroot contet ends here#
>
> As to vc90 and vc80 you probably need to add --toolset=msvc-8.0, or
> --toolset=msvc-9.0 to your bjam command line.
>
> My Best Regards
>
> Guido.
>
>
>
>
> On Thu, Jul 3, 2008 at 8:13 AM, <t3@spudsoft.co.uk> wrote:
>> Hi,
>>
>>
>>
>> I'm trying to learn to use boost-build/bjam on a very simple little
> project
>> using the boost program_options library.
>>
>> I'm using a single JamRoot file for building on both Linux and Vista (both
>> in 32 and 64 bit variants).
>>
>>
>>
>> And, despite google, I can't find a sensible way to specify the lib in my
>> jamroot.
>>
>>
>>
>> For Linux, this works:
>>
>> exe bob : main.cpp boost_program_options ;
>>
>>
>>
>> lib boost_program_options : : <name>boost_program_options-mt-s ;
>>
>>
>>
>> But obviously that hard-codes the name of the lib, so it only works
>> correctly for one variant and doesn't work on Windows.
>>
>> So I thought I could do something like:
>>
>> lib program_options : : <link>shared <threading>multi <variant>debug
>> <toolset>msvc <name>boost_program_options-vc90-mt-gd-1_35
>>
>>
>>
>> But
>>
>> a) That just doesn't work.
>>
>> b) boost-build doesn't seem to give me any way to distinguish between vc90
>> and vc80.
>>
>>
>>
>> So how am I supposed to specify the boost libraries?
>>
>> Surely it can't be this hard?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Jim
>>
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>>
>>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>