Visual Studio 2013 (vs120) 要求提供错误的 boost 库

我正在尝试使用 Visual Studio 2013 在 Windows 7 上编译我的一个项目.我已经安装了 Boost 1.53 并使用 cmake 设置了解决方案.

I'm trying to compile one of my projects on Windows 7, using Visual Studio 2013. I've installed Boost 1.53 and setup the solution using cmake.

现在boost的编译库的格式是libboost_*-vc120-mt(-gd)-1_53.lib.在链接器项目选项中,在输入选项卡下,我已经验证了我需要的库在那里,并且实际上编译器能够正确读取它们.

What happens is that now the compiled libraries of boost are in the form libboost_*-vc120-mt(-gd)-1_53.lib. In the linker project options, under the input tab, I have verified that the libraries that I need are there, and in fact the compiler is able to correctly read them.

然而,出于某种我绝对无法理解的原因,链接器也在尝试查找编译为 vc110 的库.例如:

However, for some reason that I absolutely can't understand, the linker is also trying to find libraries compiled as vc110. For example:

error LNK1104: cannot open file 'libboost_filesystem-vc110-mt-gd-1_53.lib'

项目选项中列出的平台工具集是Visual Studio 2013 (v120)".我在任何项目选项中都找不到对 vc110 的任何引用.你能帮我理解发生了什么吗?

The Platform Toolset that is listed in the project option is "Visual Studio 2013 (v120)". I couldn't find any reference to vc110 in any of the project options. Can you help me understand what is happening?

推荐答案

感谢这篇文章解决了我的问题.我以前找不到它.解决办法是编辑boost/config/auto_link.hpp,因为里面的代码无法处理vc120,最后提示vc110

This post thankfully solves my question. I wasn't able to find it before. The solution is to edit the boost/config/auto_link.hpp because the code inside is not able to handle vc120, and ends up suggesting vc110

如何我应该指定链接到哪个版本的 boost 库?

相关文章