boost 1.49.0 on Redhat 5.2 link issues
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
On Tue, 11 Jun 2013 18:08:37 +0200, Stefan Schwarzer
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
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
On Wednesday 12 June 2013 08:56:01 Slava wrote:
On Tue, 11 Jun 2013 18:08:37 +0200, Stefan Schwarzer
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
However, we have a problem even linking a mostly trivial example:
#include
int main () { copy_file(boost::filesystem::path("atest"),
boost::filesystem::path("btest"));
}
Hi Roald and Stefan.
pass --verbose to ld (using -Wl,-verbose with g++), maybe you'll see something unexpected
-- Slava
Thanks a lot! I turned out that there are some older versions of filesystem and system in /usr/lib which were used during link whereas the includes were taken from our new installation. What was confusing in the end were the rules according to which includes and libraries were searched by g++. Thanks again, Stefan. -- Dr. Stefan Schwarzer Fraunhofer-Institut für Physikalische Messtechnik IPM, Laser Scanning Heidenhofstr. 8, 79110 Freiburg, Germany Telefon: +49-(0)761-8857-366 / Mobil: +49-(0)172 6242286 stefan.schwarzer@ipm.fraunhofer.de http://www.ipm.fraunhofer.de
participants (2)
-
Slava
-
Stefan Schwarzer