Visual Studio 链接器找不到 libboost_system
我正在使用 VS 2008 并且想要使用 boost::asio 库。 我可以让它在一个新项目中工作(我想包含 boost/bind.hpp 和 boost/asio.hpp),但在现有项目中我收到此错误:
fatal error LNK1104: Datei "libboost_system-vc90-mt-找不到 sgd-1_46.lib”。
我在 boost 目录中找不到这个文件,但是这个:libboost_system-vc90-mt-gd-1_46.lib(gd 而不是 sgd) 这意味着什么?
谢谢你!
I'm using VS 2008 and want to use the boost::asio library.
I could get this to work in a new project (I want to include boost/bind.hpp and boost/asio.hpp), but in an existing project I get this error:
fatal error LNK1104: Datei "libboost_system-vc90-mt-sgd-1_46.lib" cannot be found.
I can't find this file in the boost directory, but this one: libboost_system-vc90-mt-gd-1_46.lib (gd instead of sgd) What could that mean?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我假设您已经使用了 BoostPro 的 Boost 安装程序。如果是这样,请重新安装它并确保选择
多线程调试,静态运行时
。I assume you've used the Boost installer from BoostPro. If so reinstall it and make sure you select
Multithread Debug, static runtime
.Boost 根据编译时使用的选项来命名其库 。例如,“mt”的意思是“多线程运行时”;我相信您可以弄清楚“vc90”的含义(与“gcc4”相比)。我认为“s”的意思是“静态”。
您的解决方案是首先确保您使用的选项与构建库时使用的选项相同,然后更改您在项目选项中链接的文件的名称。
Boost names its libraries based on what options were used in compiling them. "mt," for instance, means "multi-threaded runtime"; and I'm sure you can figure out what "vc90" means (compared to, say, "gcc4"). I think the "s" means "static."
Your solution is to first make sure you're using the same options that were used in building the library, and then change the name of the file you're linking against in the project options.
这意味着您必须转到项目属性并更改当前包含用于链接的 boost 库的名称。如果您有 libboost_system-vc90-mt-gd-1_46.lib,则应该使用它。
It means you have to go to the project properties and change the name of the boost library that is currently included for linking. If you have libboost_system-vc90-mt-gd-1_46.lib, you should use it.