Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-12-16 13:07:40


Alan wrote:
> I built boost thus:
>
> bjam "-sTOOLS=darwin" -sBUILD="debug release
> <runtime-link>static/dynamic"
>
> After hacking around the xml_grammar.cpp problems, I get the
> link errors where the following functions cannot be found.

I presume at this point everything seems to build properly.

>
> I'm wondering if some test functions that are not meant to
> be in the library are referenced by something included in
> the library.
>
> darwin-Link-DyLib-action
>
>
>
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/runti
me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd-1_32.dylib
> ld: Undefined symbols: cpp_main(int, char**)
>
>
> darwin-Link-DyLib-action
>
>
 <snip>

These error messages indicate that the serialization test programs are being
built but that the boost.test library isn't being linked in.

If you're impatient - and who isn't - you can try to build the simplest demo
program from the serialiation library. Its called, er, demo.cpp. This
doesn't depend on any boost libraries other than serialization.

I'll presume that didn't work. But now we can get down to business.

I'm speculating a little here. This information below is (sort of) in the
"Getting Started" section of the boost documentation. Your bjam command
above built the libraries in a subtree called bin/boost/ .... which is
pretty deep. To use any of the libraries, you have to link to them. This
is kind of inconvenient. I would recommend changing the above command to:

bjam "-sTOOLS=darwin" -sBUILD="debug release> <runtime-link>static/dynamic"
stage

The "stage" target will do everything the original did (if necessary) and
copy the built directories to one single easy to use directory called
$(BOOST_ROOT)/stage . These libraries can be linked to your applications to
supply the library code.

Going to the documentatio section "Getting Started" you will find
information what will indicate the file name of the library that corresponds
to the type of link you want to do debug/release, etc. so now you should be
able to figure out how to link the demo applicaiton.

If your really a glutton for punishment and you have about 50 G of diskspace
and couple of hours of free computer time, you can run the whole boost
test. I'm not going into detail here, but it would useful if you want run
in release mode as boost tests are mostly run in debug builds.

Good luck.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk