Boost logo

Boost :

From: Karmethia Thompson (kcthomps_at_[hidden])
Date: 2020-09-15 16:44:59

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")

## Common parameters.
# Set common path variables. (YOURS MAY BE DIFFERENT)

include_directories (${ARMADILLO_HOME}/include)
link_directories (${ARMADILLO_HOME}/lib64)

# Set the path to Boost
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})


    # Retrieve the list of source files.
    file (GLOB MODULE_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/*.cpp)

    add_executable (main
target_link_libraries(main boost_log)
target_link_libraries (main ${Boost_LIBRARIES} -lpthread)

On Tue, Sep 15, 2020 at 12:14 PM Andrey Semashev via Boost <
boost_at_[hidden]> wrote:

> On 9/15/20 5:34 PM, Karmethia Thompson via Boost wrote:
> > Good morning,
> >
> > I am trying to create a logger that uses Boost Log. I was successful
> > getting my code to compile with 1.63.0, so I know that I am not too far
> off
> > of the mark. cmake/make throws a linking issues whenever I attempt to
> > create a sink:
> [snip]
> > Can someone please help? I have tried everything from trying to
> dynamically
> > and statically link. I've added both "log" and "log_setup" to the
> > find_packages in cmake and have also explicitly specified the locations
> of
> > those libraries as well.
> The error messages indicate you're missing symbols defined in libboost_log.
> I think you either didn't specify the library to link with, or you might
> be affected by this bug:
> The solution is to use target_link_libraries to explicitly link with
> libboost_log, e.g.:
> target_link_libraries(${MY_TARGET} boost_log)
> _______________________________________________
> Unsubscribe & other changes:

Karmethia Thompson
Applied Mathematics, PhD

Boost list run by bdawes at, gregod at, cpdaniel at, john at