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. Nat123域名设置使用

    可以设自己的域名映射到内网ip:  http://www.nat123.com/Pages_18_294.jsp 暂时还没学习使用,先保存一下

  2. eclipse部署和启动guns

    eclipse部署guns: 1.import -> 搜索maven -> Existing Maven Projects -> 选择guns根目录 2.修改配置文件: spring ...

  3. application.yml配置log日志

    #日志文件的配置logging: pattern: console: "%d - %msg%n" file: /var/log/sell.log 注解@Slf4j

  4. Django pymysql学员管理系统

    学员管理系统 项目规划阶段 项目背景 近年来老男孩教育的入学学员数量稳步快速增长,传统的excel统计管理学员信息的方式已经无法满足日渐增长的业务需求.因此公司急需一套方便易用的“学员管理系统”,来提 ...

  5. 2 Python 基本语法

    编译型与解释型. 编译器是把源程序的每一条语句都编译成机器语言,并保存成二进制文件,这样运行时计算机可以直接以机器语言来运行此程序,速度很快; 而解释器则是只在执行程序时,才一条一条的解释成机器语言给 ...

  6. 整理下PC和移动获取点击、移动坐标的代码和坑

    一.PC PC是通过鼠标点击和移动,相对比较简单,比如onmousedown.onmouseup.onmousemove.onmouseout鼠标按键按下.按键起来.鼠标在元素上移动.鼠标从元素上离开 ...

  7. 不同OpenCV版本和不同VS版本之间进行配置的注意事项

    下面内容为不同系统和不同版本VS+不同版本OpenCV之间进行配置时的注意事项.本教程中开始提到如果VS版本和OpenCV版本相匹配的话,只要按上述步骤配置都是没有问题的.但是如果说版本不匹配的话,就 ...

  8. UVA - 11107 Life Forms (广义后缀自动机)

    题意:给你n个字符串,求出在超过一半的字符串中出现的所有子串中最长的子串,按字典序输出. 对这n个字符串建广义后缀自动机,建完后每个字符串在自动机上跑一遍,沿fail树向上更新所有子串结点的出现次数( ...

  9. jQuery判断 form表单提交时一些文本框的判断

    一: form表单提交时如果表单里有input标签为空那么不提交form表单. <head> <script type="text/javascript"> ...

  10. SQLite连接C#笔记

    不得不吐槽,实在是太坑了.以下几点一定要注意: 要下载两个东西,都要上官网.一个是SQLite for Windows,一个是System.Data.SQLite. 下载下来的DLL里面有个test, ...