1. 使用动态库时,要定义 BOOST_LOG_DYN_LINK  或者 BOOST_ALL_DYN_LINK

否则会出现如下错误:

CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `xxxx::Init(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/xxxx.cpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point::rotation_at_time_point(unsigned char, unsigned char, unsigned char)'
/xxxx.cpp:: undefined reference to `boost::log::v2s_mt_posix::core::get()'
/xxxx.cpp:: undefined reference to `boost::log::v2s_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::record::reset()':
/usr/include/boost/log/core/record.hpp:: undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~basic_logger':
/usr/include/boost/log/sources/basic_logger.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute_set::~attribute_set()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~once_block_sentry':
/usr/include/boost/log/utility/once_block.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::rollback()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::aux::once_block_sentry::executed() const':
/usr/include/boost/log/utility/once_block.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::enter_once_block() const'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::expressions::tag::message::get_name()':
/usr/include/boost/log/expressions/message.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::default_attribute_names::message()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `current_process_id':
/usr/include/boost/log/attributes/current_process_id.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::this_process::get_id()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::attributes::current_thread_id::impl::dispatch(boost::log::v2s_mt_posix::type_dispatcher&)':
/usr/include/boost/log/attributes/current_thread_id.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::this_thread::get_id()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::attributes::current_thread_id::impl::detach_from_thread()':
/usr/include/boost/log/attributes/current_thread_id.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::this_thread::get_id()'
/usr/include/boost/log/attributes/current_thread_id.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/current_thread_id.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~impl':
/usr/include/boost/log/attributes/attribute.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/attribute.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~impl':
/usr/include/boost/log/attributes/attribute_value.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/attribute_value.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `current_thread_id':
/usr/include/boost/log/attributes/current_thread_id.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::add_common_attributes()':
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::get()'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::default_attribute_names::line_id()'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::add_global_attribute(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute const&)'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::default_attribute_names::timestamp()'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::add_global_attribute(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute const&)'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::default_attribute_names::process_id()'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::add_global_attribute(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute const&)'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::default_attribute_names::thread_id()'
/usr/include/boost/log/utility/setup/common_attributes.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::add_global_attribute(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `constant':
/usr/include/boost/log/attributes/constant.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/constant.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `counter':
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `basic_clock':
/usr/include/boost/log/attributes/clock.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::logger, boost::log::v2s_mt_posix::sources::single_thread_model, boost::log::v2s_mt_posix::sources::features<void,
void, void, void, void, void, void, void, void, void> >::open_record()':
/usr/include/boost/log/sources/basic_logger.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::get_logging_enabled() const'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~record_pump':
/usr/include/boost/log/sources/record_ostream.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::unhandled_exception_count()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `basic_logger':
/usr/include/boost/log/sources/basic_logger.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::get()'
/usr/include/boost/log/sources/basic_logger.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute_set::attribute_set()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~attribute_value_impl':
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~impl':
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::format,
char const []>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::time_based_rotation, boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::rotation_size,
int const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::open_mode, std::_Ios_Openmode const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > const>, boost::parameter::aux::empty_arg_list> > > > > >(boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::format, char const
[]>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::time_based_rotation, boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::rotation_size,
int const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::open_mode, std::_Ios_Openmode const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > const>, boost::parameter::aux::empty_arg_list> > > > > const&)':
/usr/include/boost/log/utility/setup/file.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::set_file_collector(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::file::collector> const&)'
/usr/include/boost/log/utility/setup/file.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::scan_for_files(boost::log::v2s_mt_posix::sinks::file::scan_method, bool)'
/usr/include/boost/log/utility/setup/file.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::get()'
/usr/include/boost/log/utility/setup/file.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::detail::sp_if_not_array<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >::type boost::make_shared<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >()':
/usr/include/boost/smart_ptr/make_shared_object.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::basic_text_ostream_backend()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::logger, boost::log::v2s_mt_posix::sources::single_thread_model>::open_record_unlocked<boost::parameter::aux::empty_arg_list>(boost::parameter::aux::empty_arg_list
const&)':
/usr/include/boost/log/sources/basic_logger.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::open_record(boost::log::v2s_mt_posix::attribute_set const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `record_pump':
/usr/include/boost/log/sources/record_ostream.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
/usr/include/boost/log/sources/record_ostream.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::unhandled_exception_count()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~auto_release':
/usr/include/boost/log/sources/record_ostream.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2s_mt_posix::aux::stream_provider<char>::stream_compound*)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::core::push_record(boost::rv<boost::log::v2s_mt_posix::record>&)':
/usr/include/boost/log/core/core.hpp:: undefined reference to `boost::log::v2s_mt_posix::core::push_record_move(boost::log::v2s_mt_posix::record&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::text_file_backend::construct<boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::format, char const []>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::time_based_rotation,
boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::rotation_size, int const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::open_mode,
std::_Ios_Openmode const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const>, boost::parameter::aux::empty_arg_list>
> > > > >(boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::format, char const []>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::time_based_rotation,
boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::rotation_size, int const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::open_mode,
std::_Ios_Openmode const>, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const>, boost::parameter::aux::empty_arg_list>
> > > > const&)':
/usr/include/boost/log/sinks/text_file_backend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::construct(boost::filesystem::path const&, std::_Ios_Openmode, unsigned long, boost::log::v2s_mt_posix::aux::light_function<bool
()()> const&, bool)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::basic_formatter<char> boost::log::v2s_mt_posix::parse_formatter<char>(char const*)':
/usr/include/boost/log/utility/setup/formatter_parser.hpp:: undefined reference to `boost::log::v2s_mt_posix::basic_formatter<char> boost::log::v2s_mt_posix::parse_formatter<char>(char const*, char const*)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >::destroy()':
/usr/include/boost/smart_ptr/make_shared_object.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::~basic_text_ostream_backend()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::text_file_backend>::destroy()':
/usr/include/boost/smart_ptr/make_shared_object.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::~text_file_backend()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::aux::light_function<bool ()()>::impl<boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point>::invoke_impl(boost::log::v2s_mt_posix::aux::light_function<bool ()()>::impl_base*)':
/usr/include/boost/log/detail/light_function_pp.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::file::rotation_at_time_point::operator()() const'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char>
>&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>,
std::allocator<char> >&>) const':
/usr/include/boost/log/attributes/value_visitation.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/include/boost/log/attributes/value_visitation.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/include/boost/log/attributes/value_visitation.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::attach_attribute_name_info(boost::exception&, boost::log::v2s_mt_posix::attribute_name const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::array<std::pair<boost::log::v2s_mt_posix::type_info_wrapper, void*>, 2ul> const& boost::log::v2s_mt_posix::aux::type_sequence_dispatcher<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >::get_dispatching_map<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char,
std::char_traits<char>, std::allocator<char> >&> >()':
/usr/include/boost/log/utility/type_dispatch/static_type_dispatcher.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::commit()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >& boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >::formatted_write<wchar_t>(wchar_t
const*, long)':
/usr/include/boost/log/utility/formatting_ostream.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::code_convert(wchar_t const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::locale const&)'
/usr/include/boost/log/utility/formatting_ostream.hpp:: undefined reference to `boost::log::v2s_mt_posix::aux::code_convert(wchar_t const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::locale const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~impl':
/usr/include/boost/log/attributes/clock.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/clock.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~impl_generic':
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~impl_dec':
/usr/include/boost/log/attributes/counter.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o:/usr/include/boost/log/attributes/counter.hpp:: more undefined references to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)' follow
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::attributes::basic_clock<boost::log::v2s_mt_posix::attributes::local_time_traits>::impl::get_value()':
/usr/include/boost/log/attributes/clock.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/clock.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `boost::log::v2s_mt_posix::attribute_value boost::log::v2s_mt_posix::attributes::make_attribute_value<unsigned int>(unsigned int const&)':
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator new(unsigned long)'
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::log::v2s_mt_posix::record_view const&,
boost::mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&)':
/usr/include/boost/log/sinks/basic_sink_frontend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::consume(boost::log::v2s_mt_posix::record_view const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::mutex&,
boost::log::v2s_mt_posix::sinks::text_file_backend&)':
/usr/include/boost/log/sinks/basic_sink_frontend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::consume(boost::log::v2s_mt_posix::record_view const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::log::v2s_mt_posix::aux::fake_mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::log::v2s_mt_posix::record_view
const&, boost::log::v2s_mt_posix::aux::fake_mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&)':
/usr/include/boost/log/sinks/basic_sink_frontend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::consume(boost::log::v2s_mt_posix::record_view const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::flush_backend_impl<boost::mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&,
mpl_::bool_<true>)':
/usr/include/boost/log/sinks/basic_sink_frontend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::flush()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::log::v2s_mt_posix::aux::fake_mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view
const&, boost::log::v2s_mt_posix::aux::fake_mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)':
/usr/include/boost/log/sinks/basic_sink_frontend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::consume(boost::log::v2s_mt_posix::record_view const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&)'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::flush_backend_impl<boost::mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&,
mpl_::bool_<true>)':
/usr/include/boost/log/sinks/basic_sink_frontend.hpp:: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::flush()'
CMakeFiles/xxxx.dir/xxxx.cpp.o: In function `~attribute_value_impl':
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'
/usr/include/boost/log/attributes/attribute_value_impl.hpp:: undefined reference to `boost::log::v2s_mt_posix::attribute::impl::operator delete(void*, unsigned long)'

2. 使用静态库时,注意 libboost_log_setup.a和libboost_log.a 两个库的顺序, 正确的顺序是 libboost_log_setup.a 应该在 libboost_log.a 之前.

否则会出现一下错误:

/usr/lib/gcc/x86_64-redhat-linux/4.4./../../../../lib64/libboost_log_setup.a(formatter_parser.o): In function `boost::log::v2s_mt_posix::(anonymous namespace)::formatter_grammar<wchar_t>::formatter_grammar()':
formatter_parser.cpp:(.text+0x6015): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard_wide>::graph'
formatter_parser.cpp:(.text+0x6541): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard_wide>::alnum'
formatter_parser.cpp:(.text+0x6548): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard_wide>::space'
formatter_parser.cpp:(.text+0x65c2): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard_wide>::alpha'
formatter_parser.cpp:(.text+0x683c): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard_wide>::print'
/usr/lib/gcc/x86_64-redhat-linux/4.4./../../../../lib64/libboost_log_setup.a(formatter_parser.o): In function `boost::log::v2s_mt_posix::(anonymous namespace)::formatter_grammar<char>::formatter_grammar()':
formatter_parser.cpp:(.text+0x7efa): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard>::graph'
formatter_parser.cpp:(.text+0x8307): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard>::alnum'
formatter_parser.cpp:(.text+0x830e): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard>::space'
formatter_parser.cpp:(.text+0x8388): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard>::alpha'
formatter_parser.cpp:(.text+0x85f4): undefined reference to `boost::log::v2s_mt_posix::aux::encoding_specific<boost::spirit::char_encoding::standard>::print'

Boost log中的几个问题的更多相关文章

  1. 编译boost.log模块遇到的一些问题

    线上日志用到的是日志库,在全局有一个锁,导致在高并发的时候,容易因为锁竞争问题导致时延.在某些情况下,会因为同一个用户,同时访问某个变量,导致读写冲突使线上服务整体core掉(考虑到请求的间隔,为了应 ...

  2. boost.log在项目中应用

    //头文件#pragma once #include <string> #include <boost/log/trivial.hpp> using std::string; ...

  3. Boost.log

    =================================版权声明================================= 版权声明:本文为博主原创文章 未经许可不得转载  请通过右 ...

  4. boost.log要点笔记

    span.kw { color: #007020; font-weight: bold; } code > span.dt { color: #902000; } code > span. ...

  5. boost库中的 program_options

    1.阅读rviz中的源码时在rviz/visualizer_app.cpp中遇到如下代码: po::options_description options; options.add_options() ...

  6. Boost Log 基本使用方法

    Boost Log 基本使用方法 flyfish 2014-11-5 依据boost提供的代码演示样例,学习Boost Log 的基本使用方法 前提 boost版本号boost_1_56_0 演示样例 ...

  7. C++ 日志库 boost::log 以及 glog 的对比

    日志能方便地诊断程序原因.统计程序运行数据,是大型软件系统必不可少的组件之一.本文将从设计上和功能上对比 C++ 语言常见的两款日志库: boost::log 和 google-glog . 设计 b ...

  8. boost.asio与boost.log同时使用导致socket不能正常收发数据

    现象: 1. 没有使用boost.log前能正常收发数据 2.加入boost.log后async_connect没有回调 fix过程: 1. gdb调试发现程序block在pthread_timed_ ...

  9. 从log中分析Android wif连接状态的方法

    1.这里是从log中通过搜索关键字wpa_supplicant: wlan0: State过滤之后的log: Line 1: 11-25 20:10:14.968120  1104  1104 D w ...

随机推荐

  1. Flask download file vs django download file

    Only difference is make_response and httpresponse. FLASK VERSION: from flask import make_response @a ...

  2. power designer 设计数据库生成到oracle数据库

    一.概念模型设计 1. 创建工程,创建概念设计模型,在快捷菜单栏调出 palette 找到表格工具,在主界面中创建表格. 2. 创建出的表格,双击进入设计模式 -------------------- ...

  3. MAMP mac下启动Mysql

    MAMP mac下启动Mysql /Applications/MAMP/Library/bin/mysql -u root -p 初始密码 root:

  4. @angular/cli项目构建--modal

    环境准备: cnpm install ngx-bootstrap-modal --save-dev impoerts: [BootstrapModalModule.forRoot({container ...

  5. spring学习-4

    bean的作用域 使用bean的scope属性来配置bean的作用域 scope="singleton":默认是单例模式即容器初始化创建bean实例,在整个容器的生命周期内只创建这 ...

  6. OpenCV教程【002 VideoCapture加载并播放视频】

    #include <opencv2/opencv.hpp> #include <iostream> using namespace std; using namespace c ...

  7. UVA - 11916 Emoogle Grid (组合计数+离散对数)

    假如有这样一道题目:要给一个M行N列的网格涂上K种颜色,其中有B个格子不用涂色,其他每个格子涂一种颜色,同一列中的上下两个相邻格子不能涂相同颜色.给出M,N,K和B个格子的位置,求出涂色方案总数除以1 ...

  8. hdu 1937 Finding Seats

    Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission( ...

  9. swing之flowlayout

    import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; //1.继承 JFrame类 // ...

  10. 使用window.print()后,未关闭打印页面,原网页不能操作

    使用window.print()后,未关闭打印页面,原网页不能操作,此时可以试着用window.location.reload()重新加载页面解决问题.