wrap CMake error

Issue #454 resolved
Varun Agrawal created an issue

When setting CMAKE_BUILD_TYPE=Debug, running make fails with this error

libwrap_libDebug.a(Module.cpp.o): In function `boost::filesystem::create_directories(boost::filesystem::path const&)':
/usr/local/include/boost/filesystem/operations.hpp:566: undefined reference to `boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*)'
libwrap_libDebug.a(utilities.cpp.o): In function `boost::filesystem::operator/(boost::filesystem::path const&, boost::filesystem::path const&)':
/usr/local/include/boost/filesystem/path.hpp:792: undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
libwrap_libDebug.a(utilities.cpp.o): In function `boost::filesystem::exists(boost::filesystem::path const&)':
/usr/local/include/boost/filesystem/operations.hpp:446: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
libwrap_libDebug.a(utilities.cpp.o): In function `boost::filesystem::is_directory(boost::filesystem::path const&)':
/usr/local/include/boost/filesystem/operations.hpp:451: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
libwrap_libDebug.a(utilities.cpp.o): In function `boost::filesystem::create_directory(boost::filesystem::path const&)':
/usr/local/include/boost/filesystem/operations.hpp:572: undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
wrap/CMakeFiles/wrap.dir/build.make:88: recipe for target 'wrap/wrap' failed
make[2]: *** [wrap/wrap] Error 1
CMakeFiles/Makefile2:822: recipe for target 'wrap/CMakeFiles/wrap.dir/all' failed
make[1]: *** [wrap/CMakeFiles/wrap.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

This seems to be due the way WRAP_BOOST_LIBRARIES is set in wrap/CMakesLists.txt where optimized is repeated instead of the second one being debug.

Comments (2)

  1. Varun Agrawal reporter

    @dellaert the fix is really easy. Just update to

    set(WRAP_BOOST_LIBRARIES
      optimized
        ${Boost_FILESYSTEM_LIBRARY_RELEASE}
        ${Boost_SYSTEM_LIBRARY_RELEASE}
        ${Boost_THREAD_LIBRARY_RELEASE}
      debug
        ${Boost_FILESYSTEM_LIBRARY_DEBUG}
        ${Boost_SYSTEM_LIBRARY_DEBUG}
        ${Boost_THREAD_LIBRARY_DEBUG}
    )
    

    I'm submitting a PR once the make check passes.

  2. Log in to comment