Boost logo

Boost Users :

Subject: Re: [Boost-users] boost 1.49.0 on Redhat 5.2 link issues
From: Slava (Viatcheslav.Sysoltsev_at_[hidden])
Date: 2013-06-12 02:56:01


On Tue, 11 Jun 2013 18:08:37 +0200, Stefan Schwarzer
<stefan.schwarzer_at_[hidden]> wrote:

>
> Dear everybody,
>
> we need to backport boost 1.49.0 to Redhat 5.2.
> b2 ; b2 install --prefix=/usr/local succeeds and installs libraries and
> headers in /usr/local as
> requested (g++ 4.1.2-42, 32 bit PAE kernel). However, we have a problem
> even linking a mostly
> trivial example:
>
> #include <boost/filesystem.hpp>
> int main () {
> copy_file(boost::filesystem::path("atest"),
> boost::filesystem::path("btest"));
> }
>
> $ g++ testBoost.cpp -lboost_filesystem -lboost_system
> /tmp/cc10doAS.o: In function
> `boost::filesystem3::copy_file(boost::filesystem3::path const&,
> boost::filesystem3::path const&)':
> testBoost.cpp:
> (.text._ZN5boost11filesystem39copy_fileERKNS0_4pathES3_[boost::filesystem3::copy_file(boost::filesystem3::path
> const&, boost::filesystem3::path const&)]+0x24): undefined reference to
> `boost::filesystem3::detail::copy_file(boost::filesystem3::path const&,
> boost::filesystem3::path const&,
> boost::filesystem3::copy_option::enum_type, boost::system::error_code*)'
> collect2: ld returned 1 exit status
>
> The symbol is present in /usr/local/lib/libboost_filesystem and ldconfig
> does know about its location
> (see below). Also, trying to link statically or adding -pthread does not
> change the situation.
> We are desperate for advice...
>
> Roald and Stefan.
>
> $ nm -C /usr/local/lib/libboost_filesystem.so | grep
> 'boost::filesystem3::detail::copy_file'
> 00010ae0 T
> boost::filesystem3::detail::copy_file(boost::filesystem3::path const&,
> boost::filesystem3::path const&,
> boost::filesystem3::copy_option::enum_type,
> boost::system::error_code*)
>
> $ cat /etc/ld.so.conf
> include ld.so.conf.d/*.conf
>
> /usr/local/lib

Hi Roald and Stefan.

pass --verbose to ld (using -Wl,-verbose with g++), maybe you'll see
something unexpected

-- Slava


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