[英]Cannot understand what linker is complaining about
When compiling my project that uses boost logging library, I am getting following linker error.编译使用 boost 日志库的项目时,出现以下链接器错误。
LNK2001 unresolved external symbol "public: static class boost::log::v2s_mt_nt6::sources::severity_logger_mt __cdecl my_logger::construct_logger(void)" (?construct_logger@my_logger@@SA?AV?$severity_logger_mt@W4severity_level@trivial@v2s_mt_nt6@log@boost@@@sources@v2s_mt_nt6@log@boost@@XZ)
LNK2001 未解析的外部符号“public: static class boost::log::v2s_mt_nt6::sources::severity_logger_mt __cdecl my_logger::construct_logger(void)” (?construct_logger@my_logger@@SA?AV?$severity_logger_mt@W4severity_level@trivial@vnt @log@boost@@@sources@v2s_mt_nt6@log@boost@@XZ)
I don't know how to read this error message with mangled function names.我不知道如何使用损坏的函数名称阅读此错误消息。 Can anyone tell me in human readable way what function it cannot find?
谁能以人类可读的方式告诉我它找不到什么功能?
Googling "boost log unresolved external symbol" leads to https://www.boost.org/doc/libs/1_59_0/libs/log/doc/html/log/rationale/namespace_mangling.html (first, highlighted hit) which describes BOOST_LOG_DYN_LINK
.谷歌搜索“boost log unresolved external symbol”导致https://www.boost.org/doc/libs/1_59_0/libs/log/doc/html/log/rationale/namespace_mangling.html (第一个,突出显示的命中),它描述了
BOOST_LOG_DYN_LINK
.
This incidentally also the most frequent answer on SO: https://stackoverflow.com/search?tab=votes&q=%5bboost-log%5d%20linker顺便说一下,这也是 SO 上最常见的答案: https : //stackoverflow.com/search? tab = votes & q =% 5bboost-log%5d% 20linker
However ABI issues can play a role, see eg Unresolved external when using boost log然而,ABI 问题可以发挥作用,请参阅例如Unresolved external when using boost log
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.