[Filesystem] Linking problem with 1_46_1

Hi, I have recently upgraded to boost 1_46_1 and since then I am experience linking problems with the filesystem library. I have performed a standard install using ./bootstrap.sh; bjam; bjam install under Ubuntu 10.04 with the default gcc (4.4.3). I can boil the problem down to this test program: #include <boost/filesystem.hpp> #define BOOST_FILESYSTEM_VERSION 3 #define BOOST_FILESYSTEM_NO_DEPRECATED int main() { boost::filesystem::copy_file("a", "b"); } compiling this with g++ test.cpp -lboost_system -lboost_filesystem results in this error message /tmp/ccBuSw7s.o: In function `boost::filesystem3::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&)': test.cpp:(.text._ZN5boost11filesystem39copy_fileERKNS0_4pathES3_[boost::filesystem3::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&)]+0x2a): undefined reference to `boost::filesystem3::detail::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&, boost::filesystem3::copy_option::enum_t, boost::system::error_code*)' collect2: ld returned 1 exit status I had a look at this thread http://boost.2283326.n4.nabble.com/Filesystem-problems-with-g-std-c-0x-td263... but adding or removing -std=c++0x does not change anything. I also tried to see whether any special compiler options were used during the build of boost, so here is the line for operations.hpp "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/filesystem/build/gcc-4.4.3/release/link-static/threading-multi/v3/src/operations.o" "libs/filesystem/v3/src/operations.cpp" There is nothing there that strikes me as special, any ideas anyone. Regards Max -- Max Moorkamp IFM-GEOMAR Wischhofstr. 1-3 24148 Kiel Tel.: Germany - 431 - 600 2570 FAX.: Germany - 431 - 600 2915

Max Moorkamp wrote:
Hi,
I have recently upgraded to boost 1_46_1 and since then I am experience linking problems with the filesystem library.
I have performed a standard install using ./bootstrap.sh; bjam; bjam install under Ubuntu 10.04 with the default gcc (4.4.3). I can boil the problem down to this test program:
#include <boost/filesystem.hpp> #define BOOST_FILESYSTEM_VERSION 3 #define BOOST_FILESYSTEM_NO_DEPRECATED
int main() { boost::filesystem::copy_file("a", "b"); }
compiling this with
g++ test.cpp -lboost_system -lboost_filesystem
It might be as simple as the order you link to the libraries. The boost filesystem library depends on the boost system library, so you should probably put "-lboost_system" after "-lboost_filesystem" on the command line to link your program. -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560

On Mon, Apr 4, 2011 at 19:55, Richard Hadsell <hadsell@blueskystudios.com>wrote:
Max Moorkamp wrote:
Hi,
I have recently upgraded to boost 1_46_1 and since then I am experience linking problems with the filesystem library.
I have performed a standard install using ./bootstrap.sh; bjam; bjam install under Ubuntu 10.04 with the default gcc (4.4.3).
I had some issues in my early attempts. My problem was with my libs location, then I installed this way: - $ ./bootstrap.sh --with-toolset=gcc --prefix=/usr/local --includedir=/usr/include --libdir=/usr/lib --with-libraries=system,date_time,thread,filesystem - $ ./bjam - # ./bjam install Before to do it even linking lboost_system and lboost_filesystem didn't work. -- *Lucas Arbiza* email: lucas.arbiza@gmail.com http://lucasarbiza.com/
participants (3)
-
Lucas Arbiza
-
Max Moorkamp
-
Richard Hadsell