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: https://gitlab.kitware.com/cmake/cmake/-/issues/20638 https://github.com/boostorg/log/issues/46 The solution is to use target_link_libraries to explicitly link with libboost_log, e.g.: target_link_libraries(${MY_TARGET} boost_log)