简体   繁体   English

尝试构建Boost.Log示例时链接错误

[英]Linking error while trying to build Boost.Log example

I have successfully built the Boost.Log library on Windows 7 for VS 2010. When I tried to run the simplest example, my program could not find the symbols for Boost.System and Boost.Filesystem, and I got the 'undefined external symbol' errors. 我已经在VS 2010的Windows 7上成功构建了Boost.Log库。当我尝试运行最简单的示例时,我的程序找不到Boost.System和Boost.Filesystem的符号,并且出现了“未定义的外部符号”错误。 I have coped with that issue by manually including libboost_filesystem-vc100-mt-gd-1_48.lib and libboost_system-vc100-mt-gd-1_48.lib in the project. 我已经通过在项目中手动包含libboost_filesystem-vc100-mt-gd-1_48.liblibboost_system-vc100-mt-gd-1_48.lib来解决该问题。

Nevertheless, now I have another problem: while trying to build the "basic_usage" example for Boost.Log I get the error 尽管如此,现在我还有另一个问题:尝试为Boost.Log构建“ basic_usage”示例时,出现错误

error LNK2019: unresolved external symbol "private: void __thiscall boost::log_mt_nt5::sinks::basic_text_file_backend<char>::construct(class boost::filesystem3::path const &,int,unsigned __int64,class boost::function0<bool> const &,bool)"

How can I solve this problem? 我怎么解决这个问题?

I have found the solution! 我找到了解决方案!

The reason was that I've built the Boost.Log with the Boost.Filesystem v2, while it was supposed to built with v3. 原因是我用Boost.Filesystem v2构建了Boost.Log,而我原本应该使用v3构建它。 I have rebuilt it correctly and now it works perfectly. 我已经正确地重建了它,现在它可以完美地工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM