Subject: [Boost-bugs] [Boost C++ Libraries] #10038: filesystem library with -std=c++11 causes undefined reference to copy_file
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-05-11 03:57:07
#10038: filesystem library with -std=c++11 causes undefined reference to copy_file
--------------------------------------------+------------------------
Reporter: jim.king@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.56.0 | Severity: Problem
Keywords: filesystem copy_file undefined |
--------------------------------------------+------------------------
{{{
#include <boost/filesystem.hpp>
int main(void)
{
boost::filesystem::copy_file("a", "b");
return 0;
}
}}}
Using either g++ 4.8.1 or clang++ 3.5 when I enable the compiler option
-std=c++11, the boost::filesystem::detail::copy_file cannot be found in
the library:
{{{
root_at_dvm-3:/tmp# g++ --version
g++ (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1
# g++ -g -I/usr/include/boost-1_56 fscopy.cpp -o fscopy
-lboost_filesystem-clang35-mt-d-1_56 -lboost_system-clang35-mt-d-1_56
# g++ -std=c++11 -g -I/usr/include/boost-1_56 fscopy.cpp -o fscopy
-lboost_filesystem-clang35-mt-d-1_56 -lboost_system-clang35-mt-d-1_56
/usr/include/boost-1_56/boost/filesystem/operations.hpp:385: error:
undefined reference to
'boost::filesystem::detail::copy_file(boost::filesystem::path const&,
boost::filesystem::path const&, boost::filesystem::copy_option,
boost::system::error_code*)'
collect2: error: ld returned 1 exit status
# /usr/bin/clang++ -g -I/usr/include/boost-1_56 fscopy.cpp -o fscopy
-lboost_filesystem-clang35-mt-d-1_56 -lboost_system-clang35-mt-d-1_56
# /usr/bin/clang++ -std=c++11 -g -I/usr/include/boost-1_56 fscopy.cpp -o
fscopy -lboost_filesystem-clang35-mt-d-1_56 -lboost_system-
clang35-mt-d-1_56
/usr/include/boost-1_56/boost/filesystem/operations.hpp:385: error:
undefined reference to
'boost::filesystem::detail::copy_file(boost::filesystem::path const&,
boost::filesystem::path const&, boost::filesystem::copy_option,
boost::system::error_code*)'
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
}}}
The boost 1.56 libraries were built with clang-3.5 on Ubuntu 12.04.2 LTS
with libstdc++ from g++-4.8.1 installed.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10038> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC