|
Boost : |
Subject: [boost] [Filesystem] problems with g++ -std=c++0x
From: Roland Bock (rbock_at_[hidden])
Date: 2010-08-25 15:49:03
Hi,
getting my feet wet with variadic templates, I switched on c++0x support
in gcc. Unfortunately, I am experiencing a linker error for the
following minimal program:
------------------
#define BOOST_FILESYSTEM_VERSION 3
#define BOOST_FILESYSTEM_NO_DEPRECATED
#include <boost/filesystem.hpp>
int main()
{
boost::filesystem::copy_file("a", "b");
}
------------------
rbock_at_rbock:~/temp/test$ g++ File.cpp -std=c++0x -I boost/1.44/include
-L boost/1.44/lib -l boost_filesystem -l boost_system
/tmp/ccwkcQpq.o: In function
`boost::filesystem3::copy_file(boost::filesystem3::path const&,
boost::filesystem3::path const&)':
File.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,
boost::system::error_code*)'
collect2: ld returned 1 exit status
Experienced on Ubuntu-10.4, 64bit, gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Other boost libraries seem to work fine, other functions within
Boost.Filesystem work fine, too.
When I rebuild boost with -std=c++0x, then the linking problem is gone,
but I experience crashes in the boost::thread constructor :-(
Any ideas?
Thanks and regards,
Roland
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk