I use the following cmake lines to configure Boost:
add_compile_options(-std=c++14 -DBOOST_LOG_DYN_LINK)
set(BOOST_ROOT "/usr/local/alk/boost_1_63_0/")
SET(Boost_USE_STATIC_LIBS OFF)
find_package(Boost 1.63 REQUIRED COMPONENTS log_setup log regex thread date_time filesystem system)
Then the sources compile, and the linker tells me similar messages:
CMakeFiles/dsmip.dir/main.cpp.o: In function `boost::log::v2_mt_posix::sources::aux::logger_singleton<dataLogger>::init_instance()':
/home/balazs/munka/neovoltaic/aufgaben/dsmip/main.cpp:(.text._ZN5boost3log11v2_mt_posix7sources3aux16logger_singletonI10dataLoggerE13init_instanceEv[_ZN5boost3log11v2_mt_posix7sources3aux16logger_singletonI10dataLoggerE13init_instanceEv]+0x2d): undefined reference to `boost::log::v2_mt_posix::sources::aux::global_storage::get_or_init(std::type_info const&, boost::shared_ptr<boost::log::v2_mt_posix::sources::aux::logger_holder_base> (*)())'
Here the following function is missing: boost::log::v2_mt_posix::sources::aux::global_storage::get_or_init(std::type_info const&, boost::shared_ptr (*)())
Going into the freshly compiled Boost stage directory:
balazs@balazs:/usr/local/alk/boost_1_63_0/stage/lib$ grep get_or_init *
Binary file libboost_log.so matches
Binary file libboost_log.so.1.63.0 matches
balazs@balazs:/usr/local/alk/boost_1_63_0/stage/lib$ strings libboost_log.so |grep get_or_init
_ZN5boost3log11v2_mt_posix7sources3aux14global_storage11get_or_initENS_9typeindex14stl_type_indexEPFNS_10shared_ptrINS3_18logger_holder_baseEEEvE
Demangling it yields: boost::log::v2_mt_posix::sources::aux::global_storage::get_or_init(boost::typeindex::stl_type_index, boost::shared_ptr (*)())
which are not identical, the first function argument type differs. I used these commands to compile Boost:
./bootstrap.sh --with-toolset=clang
./b2 --build-type=minimal --layout=system toolset=clang variant=release link=shared threading=multi runtime-link=shared stage
How can this happen? Actually, this dynamically linked Boost is my second experiment. Originally I wanted to link it statically.
Thank you in advance. Best regards: Balázs Bámer
EDIT
Now I have tried the Boost libraries I get with apt-get, and the situation is the same. However, I have found my old settings. They do work:
add_compile_options(-std=c++14)
SET(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.55 REQUIRED COMPONENTS log_setup log thread date_time filesystem system)
find_package(Threads REQUIRED)