如何指定,链接到其Boost库的版本? [英] How do I specify, which version of boost library to link to?

查看:833
本文介绍了如何指定,链接到其Boost库的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想迁移写在VS2012到VS2013的项目。

I'm trying to migrate a project written in VS2012 to VS2013.

我成功编译升压1.53.0(我第一次尝试1.54.0,但有一些编译器错误),并得到了类似的库
libboost_filesystem-VC120-MT-1_53.lib

I successfully compiled boost 1.53.0 (I first tried 1.54.0, but got some compiler errors) and got libraries like libboost_filesystem-vc120-mt-1_53.lib.

但是,试图建立我的项目时,链接器抱怨:

But when trying to build my project, the linker complains:

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

我一直在寻找在我的整个解决方案的一些项目设置,找出,为什么它试图加载旧库版本,但我没有发现任何东西。

I've been looking for some project settings in my entire solution to find out, why it's trying to load the older library version, but I didn't find anything.

如何链接器知道要使用哪个库?
我怎么能解决我的问题?

How does the linker know, which library to use? And how can I fix my problem?

推荐答案

我找到了答案,我的问题和解决我的问题在TheArtTrooper的回答此主题:

I found the answer to my question and the solution to my problem in TheArtTrooper's answer to this thread:

<一个href=\"http://stackoverflow.com/questions/17440810/how-do-i-build-boost-with-new-visual-studio-2013-$p$pview\">How我建立与新的Visual Studio 2013 preVIEW提升?

链接器知道用哪个库,因为它是在指定的提升/配置/ auto_link.hpp

The linker does know which library to use, because it is specified in boost/config/auto_link.hpp.

此文件丢失code几行来处理VC120版本:

This file is missing a few lines of code to handle the vc120 version:

#  elif defined(BOOST_MSVC) && (BOOST_MSVC < 1800)

     // vc11:
#    define BOOST_LIB_TOOLSET "vc110"

#  elif defined(BOOST_MSVC)

     // vc12:
#    define BOOST_LIB_TOOLSET "vc120"

现在它编译和链接就好了!

Now it compiles and links just fine!

这篇关于如何指定,链接到其Boost库的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆