GithubHelp home page GithubHelp logo

building log_setup failed about boost-cmake HOT 16 CLOSED

orphis avatar orphis commented on August 16, 2024
building log_setup failed

from boost-cmake.

Comments (16)

Orphis avatar Orphis commented on August 16, 2024 2

I'll see if I can upgrade to 1.66 this weekend, yes!

from boost-cmake.

Orphis avatar Orphis commented on August 16, 2024

IIRC, it has been fixed upstream, I need to bump the Boost version to fix this.

from boost-cmake.

rcdailey avatar rcdailey commented on August 16, 2024

from boost-cmake.

marcosatti avatar marcosatti commented on August 16, 2024

Just FYI, under Windows, boost 1.66 changed their library naming scheme, causing any projects to fail linking when using cmake.

Only cmake from source later than 3f4924aa60889dd2a34a2a1ba6877528779867d0 will work with the new boost.

from boost-cmake.

Zer0xFF avatar Zer0xFF commented on August 16, 2024

boost-cmake isn't linked to boost names, so unless they're explicitly changed from within this project, nothing should break.

from boost-cmake.

marcosatti avatar marcosatti commented on August 16, 2024

Ok should be no problems then!

from boost-cmake.

Coffee2CodeNL avatar Coffee2CodeNL commented on August 16, 2024

This still happens in 1.66.

libs/serialization/src/singleton.cpp is also gone in 1.66 it appears.

from boost-cmake.

Orphis avatar Orphis commented on August 16, 2024

I had little time to work on this, but I was able to build and run tests for 1.66.0 this week, everything was green. I guess I don't have enough tests for boost::log then.

from boost-cmake.

rcdailey avatar rcdailey commented on August 16, 2024

from boost-cmake.

Zer0xFF avatar Zer0xFF commented on August 16, 2024

just to add, I don't think log_setup is compiled when compiling log (but log is when log_setup is compiled) which is where this error is.

from boost-cmake.

Orphis avatar Orphis commented on August 16, 2024

Please let me know if this is still an issue with the current version and I'll reopen.

from boost-cmake.

dimiboi avatar dimiboi commented on August 16, 2024

I am still experiencing this issue with the latest version:

In file included from /Users/dmitry/Code/mx/mq-grabber-poc/cmake-build-debug/_deps/boost-src/libs/log/src/setup/init_from_settings.cpp:54:
In file included from /Users/dmitry/Code/mx/mq-grabber-poc/cmake-build-debug/_deps/boost-src/boost/log/sinks.hpp:27:
/Users/dmitry/Code/mx/mq-grabber-poc/cmake-build-debug/_deps/boost-src/boost/log/sinks/unbounded_ordering_queue.hpp:204:28: error: no member named 'timed_wait' in 'boost::condition_variable'
                    m_cond.timed_wait(lock, posix_time::milliseconds(m_ordering_window - difference));
                    ~~~~~~ ^
In file included from /Users/dmitry/Code/mx/mq-grabber-poc/cmake-build-debug/_deps/boost-src/libs/log/src/setup/init_from_settings.cpp:54:
In file included from /Users/dmitry/Code/mx/mq-grabber-poc/cmake-build-debug/_deps/boost-src/boost/log/sinks.hpp:29:
/Users/dmitry/Code/mx/mq-grabber-poc/cmake-build-debug/_deps/boost-src/boost/log/sinks/bounded_ordering_queue.hpp:231:28: error: no member named 'timed_wait' in 'boost::condition_variable'
                    m_cond.timed_wait(lock, posix_time::milliseconds(m_ordering_window - difference));
                    ~~~~~~ ^
2 errors generated.

from boost-cmake.

d3roch4 avatar d3roch4 commented on August 16, 2024

I have this problem in version boost 1.71

from boost-cmake.

jzakrzewski avatar jzakrzewski commented on August 16, 2024

Yep, happens in 1.71 as soon as I add Boost::log_setup to linked libraries. Does not happen if linking only to Boost::log

from boost-cmake.

LuxoftAKutsan avatar LuxoftAKutsan commented on August 16, 2024

But what if I need Boost::log_setup for formating, I can't use Boost::log_setup with Orphis/boost-cmake ?

My cmake :

cmake --version
cmake version 3.18.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).

My CMakeLists.txt

set(BOOST_URL https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.bz2)
SET(Boost_USE_STATIC_LIBS ON) # Try to apply solution from https://stackoverflow.com/questions/17844085/boost-log-with-cmake-causing-undefined-reference-error 
add_subdirectory(boost-cmake) 
...
target_link_libraries(UtilsLib PUBLIC Boost::log_setup Boost::log)

Output :

Scanning dependencies of target Boost_log_setup
[ 69%] Building CXX object boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/log/src/setup/default_filter_factory.cpp.o
[ 69%] Building CXX object boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/log/src/setup/default_formatter_factory.cpp.o
[ 73%] Building CXX object boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/log/src/setup/filter_parser.cpp.o
[ 73%] Building CXX object boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/log/src/setup/formatter_parser.cpp.o
[ 73%] Building CXX object boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/log/src/setup/init_from_settings.cpp.o
In file included from /home/developer/fun/dummy_project/build/_deps/boost-src/boost/log/sinks.hpp:27:0,
                 from /home/developer/fun/dummy_project/build/_deps/boost-src/libs/log/src/setup/init_from_settings.cpp:54:
/home/developer/fun/dummy_project/build/_deps/boost-src/boost/log/sinks/unbounded_ordering_queue.hpp: In member function ‘bool boost::log::v2s_mt_
posix::sinks::unbounded_ordering_queue<OrderT>::dequeue_ready(boost::log::v2s_mt_posix::record_view&)’:
/home/developer/fun/dummy_project/build/_deps/boost-src/boost/log/sinks/unbounded_ordering_queue.hpp:204:28: error: ‘class boost::condition_variab
le’ has no member named ‘timed_wait’
                     m_cond.timed_wait(lock, posix_time::milliseconds(m_ordering_window - difference));
                            ^~~~~~~~~~
In file included from /home/developer/fun/dummy_project/build/_deps/boost-src/boost/log/sinks.hpp:29:0,
                 from /home/developer/fun/dummy_project/build/_deps/boost-src/libs/log/src/setup/init_from_settings.cpp:54:
/home/developer/fun/dummy_project/build/_deps/boost-src/boost/log/sinks/bounded_ordering_queue.hpp: In member function ‘bool boost::log::v2s_mt_po
six::sinks::bounded_ordering_queue<OrderT, MaxQueueSizeV, OverflowStrategyT>::dequeue_ready(boost::log::v2s_mt_posix::record_view&)’:
/home/developer/fun/dummy_project/build/_deps/boost-src/boost/log/sinks/bounded_ordering_queue.hpp:231:28: error: ‘class boost::condition_variable
’ has no member named ‘timed_wait’
                     m_cond.timed_wait(lock, posix_time::milliseconds(m_ordering_window - difference));
                            ^~~~~~~~~~
boost-cmake/CMakeFiles/Boost_log_setup.dir/build.make:133: recipe for target 'boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/l
og/src/setup/init_from_settings.cpp.o' failed
make[2]: *** [boost-cmake/CMakeFiles/Boost_log_setup.dir/__/_deps/boost-src/libs/log/src/setup/init_from_settings.cpp.o] Error 1
CMakeFiles/Makefile2:819: recipe for target 'boost-cmake/CMakeFiles/Boost_log_setup.dir/all' failed
make[1]: *** [boost-cmake/CMakeFiles/Boost_log_setup.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

from boost-cmake.

qytek-dc avatar qytek-dc commented on August 16, 2024

The problem still exists, but the workaround for this as mentioned by OP is to set BOOST_THREAD_USES_DATETIME. I have my top level CMakeLists.txt as follows:

add_subdirectory(modules/boost-cmake)

# Workaround for "Error: class boost::condition_variable has no member 'timed_wait'"
target_compile_definitions(Boost_log_setup PRIVATE
    BOOST_THREAD_USES_DATETIME
)

Make sure the target_compile_definitions comes after the add_subdirectory

from boost-cmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.