Boost logo

Boost-Build :

Subject: Re: [Boost-build] query regarding configuring bjam for building projects in Windows and Linux
From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2012-06-25 04:31:22


> When I tried to build the application using bjam (command line: bjam -q)
> on windows using this Jamroot, the bjam command failed as it could not
> find gcc on Windows:
> C:/boostbuild/share/boost-build/tools\gcc.jam:130: in gcc.init from
> module gcc
> error: toolset gcc initialization:
> error: no command provided, default command 'g++' not found
> error: initialized from Jamroot:33
> ...
> Can you please help me know, how can I specify the correct toolset on
> Windows for bjam?

   The gcc toolset has been written so that it errors out if you try to
configure it 'incorrectly'. You are telling it to configure itself
'using default settings' which means it should auto-detect where your
g++ compiler executable is located, which it fails to do on your system.

   One quick-fix is to do 'using gcc' only on a non-windows machine,
with something like so:

> if [ ] = NT
> {
> using gcc ;
> }

   On the other hand - my suggestions is that you do not initialize
toolsets at all in your project file sources. It does not make sense
unless you can specify up-front exactly how your development/build
machines are going to be configured.

   My suggestion is to document that the developer should configure the
needed toolsets for his machine in his local user-config.jam or
site-config.jam configuration files as he is the only one who can say
'use this gcc compiler and user the gcc archiver located there...' and
that is exactly what the toolset.using rule is for. If you really want
to keep the configuration localized to your project - use
project-config.jam which they does not affect any other projects and
should be safe to generate using your own custom development environment
setup script, should you need something like that.

   If you are calling 'using gcc' just to get some gcc specific target
types/features/generators/whatever defined, presumably needed to get
your project jam files parsed correctly - just do an 'import gcc' in
your Jamroot to load it without initializing the exact toolset.

   Hope this helps.

   Best regards,
     Jurko Gospodnetić

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at