ABI of Boost changes when Boost has been built with C++11, resulting in requirement of using C++11 for a subset of reverse dependencies of Boost: $ cat test.cpp #include <boost/filesystem.hpp> int main() { boost::filesystem::copy_file("/tmp/file1", "/tmp/file2"); } $ g++ -o test test.cpp -lboost_filesystem /tmp/cceFhNtv.o: In function `boost::filesystem::copy_file(boost::filesystem::path const&, boost::filesystem::path const&)': test.cpp:(.text._ZN5boost10filesystem9copy_fileERKNS0_4pathES3_[_ZN5boost10filesystem9copy_fileERKNS0_4pathES3_]+0x26): undefined reference to `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type, boost::system::error_code*)' collect2: error: ld returned 1 exit status $ g++ -std=c++11 -o test test.cpp -lboost_filesystem $ readelf -sW /usr/lib64/libboost_filesystem-mt-1_51.so | grep copy_file 241: 000000000000c840 779 FUNC GLOBAL DEFAULT 10 _ZN5boost10filesystem6detail9copy_fileERKNS0_4pathES4_NS0_11copy_optionEPNS_6system10error_codeE $ c++filt _ZN5boost10filesystem6detail9copy_fileERKNS0_4pathES4_NS0_11copy_optionEPNS_6system10error_codeE boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*) Addition of "c++11" USE flag in Boost will allow other packages to use: if has_version "dev-libs/boost[c++11(-)]"; then append-cxxflags -std=c++11 fi
Created attachment 328390 [details, diff] boost.patch Patch backported from Progress Overlay.
Assigned herd: Just learned I shouldn't CC herd maintainers if I assign to a herd, to avoid that you receive any further comments double I have removed you from CC.
No this is not going to be the right way to do this.
What alternative solution do you suggest?
We'll decide when to enable C++11 tree-wide _after_ gcc 4.7 is generally available. So please don't open this bug again.