Skip to content

Linking error due to boost::filesystem::detail::copy_file #196

Open
@calvinmccarter

Description

@calvinmccarter

On CentOS, I first install zlib, boost, and boost-devel via yum. Then when I run cmake .., it succeeds with:

-- cotire 1.8.0 loaded.
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   date_time
--   filesystem
--   iostreams
--   regex
--   system
--   thread
--   chrono
--   atomic


** Build Summary **
  Version:          3.0.8
  Prefix:           /usr/local
  Build Type:       Release
  Architecture:     x86_64
  System:           Linux
  Boost Include:    /usr/include
  Boost Libraries:  /usr/lib64
  Zlib Include:     /usr/include
  Zlib Library:     /usr/lib64/libz.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/calvin/sandbox/LucenePlusPlus/build

But when I run make, it fails with:

[ 66%] Linking CXX executable deletefiles
../../core/liblucene++.so.3.0.8: 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
make[2]: *** [src/demo/deletefiles/deletefiles] Error 1
make[1]: *** [src/demo/deletefiles/CMakeFiles/deletefiles.dir/all] Error 2
make: *** [all] Error 2

This problem appears to show up elsewhere for Boost due to C++11: https://stackoverflow.com/questions/35007134/c-boost-undefined-reference-to-boostfilesystemdetailcopy-file, but I'm not quite sure what changes are needed in LucenePlusPlus to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions