Boost logo

Boost :

From: Alexander Grund (alexander.grund_at_[hidden])
Date: 2020-09-16 14:45:10


>> On 9/15/20 7:44 PM, Karmethia Thompson via Boost wrote:
>>> Andrey thanks for your reply. I tried that as well without success. My
>>> cmake file is below:
>>>
>>> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
>>> add_definitions(-DBOOST_LOG_DYN_LINK=1)
>>>
>>> ## Common parameters.
>>> # Set common path variables. (YOURS MAY BE DIFFERENT)
>>> set(BOOST_ROOT "$ENV{BOOST_ROOT}")
>>>
>>> set(ARMADILLO_HOME "$ENV{ARMADILLO_ROOT}")
>>> include_directories (${ARMADILLO_HOME}/include)
>>> link_directories (${ARMADILLO_HOME}/lib64)
>>> #SET(CMAKE_VERBOSE_MAKEFILE ON)
>>>
>>> # Set the path to Boost
>>> #SET(Boost_USE_STATIC_LIBS ON)
>>> #SET(Boost_USE_MULTITHREADED ON)
>>> find_package (Boost COMPONENTS log log_setup system thread filesystem
>>> date_time  REQUIRED)
>>> include_directories (${Boost_INCLUDE_DIRS})
>>> link_directories (${Boost_LIBRARY_DIRS})
>>> #link_libraries(${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES})
>>>
>>> include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
>>> include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/modules")
>>>
>>>      # Retrieve the list of source files.
>>>      file (GLOB SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
>>>      file (GLOB MODULE_SOURCE
>>> ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/*.cpp)
>>>
>>>      add_executable (main
>>>      main.cpp
>>>      ${SOURCE}
>>>      ${MODULE_SOURCE}
>>>                     )
>>> target_link_libraries(main boost_log)
>>> target_link_libraries (main ${Boost_LIBRARIES} -lpthread)

It likely doesn't really solve your problem, but don't use
include_directories, link_directories but the target_* variants of that.
Similar don't use Boost_INCLUDE_DIRS, Boost_LIBRARIES, ... but use the
targets provided. I.e. Boost::log

This will make your code much cleaner, shorter, hence easier to maintain
and maybe already solves your problem.

Maybe including Boost::log_setup before Boost::log in your
target_link_libraries solves the problem.

Please try that and if that fails run "make VERBOSE=1" and post the
relevant linker line.




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk