首页 > 解决方案 > Boost.Log 的链接器错误

问题描述

我在编译和链接程序时尝试使用 boost logger,如下所示,我收到以下错误。我的操作系统是 macOSHighSierra v10.13.4,我的 boost 版本是 1.67.0
非常感谢任何帮助

g++ -g -m64  -DBOOST_LOG_DYN_LINK  -c  -I/usr/local/include -I../../include   -o build/stayClassification.o main.cpp

g++ -DBOOST_ALL_DYN_LINK -g -m64 -L/usr/local/lib -o build/stayClassification build/stayClassification.o  -lboost_filesystem-mt -lboost_system-mt -lCGAL -lpthread -lboost_log_setup-mt -lboost_log-mt -lboost_thread-mt -lboost_date_time-mt -lgmp -lmpfr -lboost_iostreams-mt


Undefined symbols for architecture x86_64:
"void boost::log::v2_mt_posix::aux::put_integer<char>(boost::log::v2_mt_posix::aux::basic_ostringstreambuf<char, std::char_traits<char>, std::allocator<char> >&, unsigned int, unsigned int, char)", referenced from:





"boost::log::v2_mt_posix::aux::code_convert_impl(wchar_t const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long, std::locale const&)", referenced from:

ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status

标签: c++macosboost

解决方案


推荐阅读