Subject: Re: [boost] [Filesystem] Linking problem with 1_46_1
From: Richard Hadsell (hadsell_at_[hidden])
Date: 2011-04-04 18:55:38
Max Moorkamp wrote:
> 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_at_[hidden] Blue Sky Studios http://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk