|
Boost Users : |
Subject: Re: [Boost-users] [Ubuntu 8.04] Linking Problem in Eclipse with Boost 1.41 Libraries
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-11-25 01:08:23
Brooks Garrison wrote:
> Hello all,
>
> My question is concerning the Boost installation process. I am
> currently working on a machine that has Ubuntu 8.04 LTS. I have
> downloaded the latest copy of Boost (1.41.0) and am trying to
> successfully install it. I have followed the procedures for building
> the libraries such as Filesystem / Regex / Thread / etc. using both
> the bootstrap, "easy", method and the "build custom binaries" method.
>
> I'm using Eclipse as my C++ development environment and I can create
> programs that use the Boost headers (the ones that do not require
> compilation - ie. Lambda) just fine. When I try to implement the
> sample program that incorporates [regex], I am able to compile and
> link just fine. I've set the include directory to (
> /usr/local/boost_1_41_0/prefix/include - prefix was just the name I
> gave the folder), the library search path to (
> /usr/local/boost_1_41_0/prefix/lib ) and the library I wanted to link
> to, [regex], using (boost_regex - I have also tried
> boost_regex-gcc##-mt ).
>
> As I said though, when I try to run the program, I get the result:
>
> ./boost_regex_test: error while loading shared libraries:
> libboost_regex.so.1.41.0: cannot open shared object file: No such file
> or directory
>
> I have not specified that I was using shared libraries, so I do not
> understand why it is trying to look for them. If anyone could please
> clarify why this is happening, I'd be more than greatful.
Generally, you don't have to specify that you are using shared libraries.
In fact, on modern Linux, every library is shared. I recommend you
add /usr/local/boost_1_41_0/prefix/lib to LD_LIBRARY_PATH environment
variable.
In fact, I'd recommend creating ~/local directory and using that as
prefix for installing anything you install from source. Then, add
~/local/bin to PATH and ~/local/lib to LD_LIBRARY_PATH, and you'll
no longer have to tweak any settings when you install something
new.
HTH,
Volodya
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