Boost logo

Boost Users :

From: Michael Buksas (mb1_at_[hidden])
Date: 2004-01-31 00:48:20

Hi all,

I'm having newbie problems with linking against Boost libraries. Here's
the situation:

I can build the boost libraries without problem, and I'm using the
default toolkit for my system, (Fedora Core 1) which is g++.

Compiling is no problem, just linking. I can link the object files by
hand, but not as part of using

As a test, I grabbed an example program from the date_time library and
it's corresponding build rule. This code compiles fine as part of Boost,
but if I move it to my project space, I get linking errors.

Here's my Jamfile:

        exe time_math : <lib>$(BOOST_ROOT)/build/boost_date_time
                        : <include>$(BOOST_ROOT)

and here's my Jamrules in the same directory:

        project-root ;
        path-global BOOST_ROOT : "/opt/boost-1.30.2" ;

Here's the Jamfile from /opt/boost-1.30.2/libs/date_time/example/

        exe time_math : <lib>../build/boost_date_time
                        : <include>$(BOOST_ROOT)

And the environment variable is set:

When I run bjam from a clean build, here's what I get:

gcc-C++-action bin/time_math/gcc/debug/runtime-link-dynamic/time_math.o
gcc-Link-action bin/time_math/gcc/debug/runtime-link-dynamic/time_math
bin/time_math/gcc/debug/runtime-link-dynamic/time_math.o(.gnu.linkonce.t._ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthENS0_13simple_formatEE12format_monthERKS3_RSo+0x3a): In function `boost::date_time::month_formatter<boost::gregorian::greg_month,
     << edited for brevity >>
In function
     << edited for brevity >>
collect2: ld returned 1 exit status
    export LD_LIBRARY_PATH
    g++ -g -o
...failed gcc-Link-action
...failed updating 1 target...

So things are compiling, but not linking.

I must not have the configuration for correct, but I've
tried everything I can think of. Any help would be appreciated.

Mike Buksas

Michael Buksas --  michael_at_[hidden] --

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at