VS2010上Boost Log链接错误
我正在尝试在 VS2010 上构建并运行 Boost.Log 库。
我从他们的SVN的主干中取出了最新的文件。 我将所有头文件和源文件拖到 win32 .exe 项目中,设置所有 boost (1.47) include\lib 目录。 在使用 .mc 文件一段时间后,我设法从中生成头文件和 .rc 文件。
还要确保运行时库设置为多线程调试 DLL (/MDd)。
我的主要 cpp 文件是这样的:
#include "stdafx.h"
#include <boost/log/trivial.hpp>
int _tmain(int argc, _TCHAR* argv[]){
BOOST_LOG_TRIVIAL(error) << "An error severity message"; }
一切都编译完成,但我收到此 LINK 错误:
error LNK1104: Cannot open file 'libboost_log_setup-vc100-mt-gd-1_47.lib'
出现问题: 我正在构建一个 .exe 项目,为什么要查找这个 .lib 文件?我有消息来源和一切。 链接器如何知道名称“libboost_log_setup-vc100-mt-gd-1_47”?我在链接选项和源代码中都找不到它的任何剩余部分。
我在这里能做什么?
如果有人能指导我使用已构建且可运行的 Boost.Log VS2010 .lib,那就太好了。
聚苯乙烯 在此之前,我尝试从 boost.log 源编译 .lib 文件,并让另一个 exe 项目使用它。 .lib 构建得很好。 但在客户端项目中,我收到了此类错误:
error LNK2019: unresolved external symbol "void __cdecl boost::log_mt_nt5::trivial::aux::init(void)" (?init@aux@trivial@log_mt_nt5@boost@ @YAXXZ) 在函数“public: static class”中引用boost::log_mt_nt5::sources::severity_logger_mt __cdecl boost::log_mt_nt5::trivial::logger::construct_logger(void)" (?construct_logger@logger@trivial@log_mt_nt5@boost@@SA?AV?$severity_logger_mt@W4severity_level@trivial@log_mt_nt5@boost@@@sources@34@XZ)
I am trying to build and run the Boost.Log library on VS2010.
I took the latest files from the trunk in their SVN.
I dragged all header and source files into a win32 .exe project, setup all of boost's (1.47) include\lib directories.
After playing for a while with the .mc file I managed to generate header and .rc files from it.
Also made sure the run-time library is set to Multi-threaded Debug DLL (/MDd).
My main cpp file is this:
#include "stdafx.h"
#include <boost/log/trivial.hpp>
int _tmain(int argc, _TCHAR* argv[]){
BOOST_LOG_TRIVIAL(error) << "An error severity message"; }
Everything compiles but then I get this LINK error:
error LNK1104: cannot open file 'libboost_log_setup-vc100-mt-gd-1_47.lib'
Questions arise:
I am building an .exe project, why is this .lib file being looked for? I have the sources and all.
How does the linker know the name 'libboost_log_setup-vc100-mt-gd-1_47'? I can't find any of remnant of it in linkage options, nor in the source code.
What can I do here?
It would be best if someone could guide me to an already built and working VS2010 .lib of Boost.Log.
P.S.
Before that I have tried to compile a .lib file from the boost.log sources and have another exe project use that. The .lib was built fine.
But in the client project I received errors of this sort:
error LNK2019: unresolved external symbol "void __cdecl boost::log_mt_nt5::trivial::aux::init(void)" (?init@aux@trivial@log_mt_nt5@boost@@YAXXZ) referenced in function "public: static class boost::log_mt_nt5::sources::severity_logger_mt __cdecl boost::log_mt_nt5::trivial::logger::construct_logger(void)" (?construct_logger@logger@trivial@log_mt_nt5@boost@@SA?AV?$severity_logger_mt@W4severity_level@trivial@log_mt_nt5@boost@@@sources@34@XZ)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Boost.Log是一个编译库;它需要被建造。您可以使用 bjam 构建它,就像构建 boost 的其余部分一样。
正在搜索的文件名是它增强自动链接的结果。查看各种选项。
Boost.Log is a compiled library; it needs to be built. You can build it with bjam the same way the rest of boost is built.
The file name being searched for is a result it boost's auto linking. Check out for various options.