Garmaine Staff asked 2 years ago

I am using Eclipse to create a C++ Project (not a C/C++, Arduino, C, or Makefile project, but a C++ Project from the wizard) to research the logging capabilities of the Boost Library. I copied the code verbatim from one of Boost's examples for trivial logging, found here, but I am unable to build / run it, and am given the following compilation error in my console:

make all 
Building target: Boost Logging
Invoking: MacOS X C++ Linker
g++ -L/usr/local/lib/ -o "Boost Logging"  ./src/Runner.o   -lboost_log_setup -lpthread -lboost_system -lboost_thread-mt -lboost_log
Undefined symbols for architecture x86_64:
  "boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)", referenced from:
      boost::log::v2s_mt_posix::attribute_name::attribute_name(char const*) in Runner.o
  "boost::log::v2s_mt_posix::aux::attach_attribute_name_info(boost::exception&, boost::log::v2s_mt_posix::attribute_name const&)", referenced from:
      boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in Runner.o
  "boost::log::v2s_mt_posix::core::set_filter(boost::log::v2s_mt_posix::filter const&)", referenced from:
      init() in Runner.o
  "boost::log::v2s_mt_posix::core::get()", referenced from:
      init() in Runner.o
  "boost::log::v2s_mt_posix::attribute_value_set::end() const", referenced from:
      boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in Runner.o
  "boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const", referenced from:
      boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in Runner.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Boost Logging] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

Having been in a situation with not linking libraries property (in particular, GraphViz), I automatically assumed that it was the same issue. However, as you can see, I linked some libraries but am still getting the same build errors.

What am I missing / doing wrong?