Boost logo

Boost-Build :

Subject: [Boost-build] Errors when using target references to boost libraries
From: Bob Walters (bob.s.walters_at_[hidden])
Date: 2009-09-03 14:04:09


I'm having difficulty referring to targets in the boost library, and
would appreciate any pointers or help on what I may be doing wrong.

I have an stand-alone project which is dependent on boost. I set up
this project with its own Jamroot, which is relatively small. I'm
trying to use the directory//target syntax to refer to libraries in
the boost project. My goal is that using those targets avoids any
need to try to

<File 'Jamroot':>

import common ;
import os ;

local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;

alias libboost_serialization :
$(BOOST_ROOT)/libs/serialization/build//boost_serialization ;
alias libboost_thread : $(BOOST_ROOT)/libs/thread/build//boost_thread ;
alias libboost_filesystem :
$(BOOST_ROOT)/libs/filesystem/build//boost_filesystem ;
alias libboost_system : $(BOOST_ROOT)/libs/system/build//boost_system ;
alias libboost_date_time : $(BOOST_ROOT)/libs/date_time/build//boost_date_time ;

lib stldb
        : src/logging.cpp
          src/trace.cpp
          src/time_tracked.cpp
          src/timer.cpp
          src/bounded_interprocess_mutex.cpp
          src/db_file_util.cpp
          src/log_reader.cpp
          libboost_filesystem
          libboost_system
          libboost_date_time
        : <include>$(BOOST_ROOT)
          <include>.
          <toolset>msvc:<define>NO_STDINT_H
          <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
          <define>STLDB_TRACING
        ;
<EOF>

When I've tried doing this on MacOSX, it works - the dependencies
resolve and the library builds. Under windows, with MSVC 9.0, I'm
getting an error during the processing of the jam file. The error log
is somewhat long, but the most suggestive bit is:

*** argument error
* rule project.find ( name : current-location )
* called with: ( boost_serialization : )
* missing argument current-location
C:/c++/boost_1_39_0/tools/build/v2/build\project.jam:145:see
definition of rule 'find' being called
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:428: in
object(project-target)@411.find
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:366: in find-really
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:428: in
object(project-target)@51.find
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:794: in resolve-reference
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:811: in
targets.generate-from-reference
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:1174: in
generate-dependencies
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:1224: in
object(alias-target-class)@53.generate
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:710: in generate-really
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:682: in
object(main-target)@67.generate
C:/c++/boost_1_39_0/tools/build/v2/build\targets.jam:258: in
object(project-target)@51.generate
C:/c++/boost_1_39_0/tools/build/v2\build-system.jam:700: in load
C:\\c++\boost_1_39_0\tools/build/v2/kernel\modules.jam:283: in import
C:\\c++\boost_1_39_0\tools/build/v2/kernel/bootstrap.jam:138: in boost-build
C:\\c++\boost_1_39_0\boost-build.jam:16: in module scope

(The above is not the entire output.)

To build I am:
setting BOOST_ROOT in the env to point to my boost_1_39_0 directory.
Likewise BOOST_BUILD_PATH
bjam --debug-building -q toolset=msvc variant=debug link=static

If I abandon the approach of trying to use the target references,
instead providing explicit <file> values for the libraries, then the
build succeeds. So the issue appears to have something to do with the
process of resolving the targets.

I've tried using a boost installation which I built myself using a
pre-built bjam binary
and also tried using the pre-built boost distribution from BoostPro
consulting (with the bjam included therein.)
In both cases, the error that results is the same.

Any help / pointers / alternative techniques are much appreciated.
Thanks,

- Bob Walters


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