Boost log, GCC 4.4 and CMake

前端 未结 2 1154
[愿得一人]
[愿得一人] 2021-02-07 08:39

I am trying to get a simple boost.log example running on Linux using GCC 4.4.5, CMake 2.8.2 and Boost 1.53.0.

Compiling boost and boost log succeeded, but I keep getting

2条回答
  •  既然无缘
    2021-02-07 09:45

    It seems like boost.log depends on boost.thread library then you need change order of libraries. See why link order does matter

    Try following order

    find_package(Boost 1.53.0 COMPONENTS log log_setup thread date_time filesystem system REQUIRED)
    

    if it will not help try include them two times as following

    link_libraries(${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} ${Boost_LIBRARIES})
    

提交回复
热议问题