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 Boost.build.

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
                         time_math.cpp
                        : <include>$(BOOST_ROOT)
        <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ;

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
                          posix_time/time_math.cpp
                        : <include>$(BOOST_ROOT)
        <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
                        ;

And the environment variable is set:
        BOOST_BUILD_PATH=/opt/boost-1.30.2/tools/build

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
`boost::date_time::month_formatter<boost::gregorian::greg_month,
     << edited for brevity >>
collect2: ld returned 1 exit status
 
     
    export LD_LIBRARY_PATH
    g++ -g -o
"bin/time_math/gcc/debug/runtime-link-dynamic/time_math"
"bin/time_math/gcc/debug/runtime-link-dynamic/time_math.o"
-Wl,-rpath-link,.
     
 
...failed gcc-Link-action
bin/time_math/gcc/debug/runtime-link-dynamic/time_math...
...failed updating 1 target...

So things are compiling, but not linking.

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

Thanks,
Mike Buksas

-- 
Michael Buksas --  michael_at_[hidden] -- www.buksas.net

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net