Boost logo

Boost Users :

Subject: Re: [Boost-users] getting started tutorial: link your program to a boost library
From: Dave Abrahams (dave_at_[hidden])
Date: 2010-10-26 21:24:55


Hi Oliver,

On Sun, Oct 24, 2010 at 3:00 AM, Oliver Adams <oliver.adams_at_[hidden]> wrote:
> Hi,
>
> I've just installed boost

How did you install it?

> and have been going through the getting
> started guide (for unix variants). I am having problems with the
> section that discusses how to link your program to a boost library,
> using boost.regex as an example.
>
> $ c++ -I path/to/boost_1_44_0 example.cpp -o example \
>   ~/boost/stage/lib/libboost_regex-gcc34-mt-d-1_36.a
>
> That file does not exist. In fact there is no boost directory in my
> home directory.

That's not surprising; the command-line is meant as an example. The
files you want should be below your build directory, if you're
following the Getting Started Guide. See
http://www.boost.org/doc/libs/1_44_0/more/getting_started/unix-variants.html#select-a-build-directory

> I'm not sure if running ./bjam install worked. It did build for a
> while, but the last few lines of output were:
>
> ...failed updating 60 targets...
> ...skipped 12 targets...
> ...updated 8866 targets...
>
> there seem to be a bunch of object files in
> /usr/local/boost_1_44_0/bin.v2/libs/regex/build/gcc-4.4.5/release/threading-multi
>
> unfortunately, when I try and use those files I end up getting:
>
> collect2: ld returned 1 exit status

That's a pretty uninformative error message. Is that all you get?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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