2015-04-22 129 views
6

难怪因为...\boost_1_58_0\stage\lib中没有这样的文件。我怎样才能得到一个?我只有:2> LINK:致命错误LNK1104:无法打开文件'libboost_filesystem-vc120-mt-sgd-1_58.lib'

boost_1_58_0\stage\lib\libboost_filesystem-vc120-mt-s-1_58.lib 
boost_1_58_0\stage\lib\libboost_filesystem-vc120-s-1_58.lib 

在那里。试图编译各种选择结束了与黏合--build-type=complete它(“穷人的”从Linker error LNK1104 with 'libboost_filesystem-vc100-mt-s-1_49.lib'解决方案),以获得提升:

> b2 toolset=msvc threadapi=win32 link=static runtime-link=static \ 
variant=release address-model=32 --with-filesystem --with-locale --with-regex \ 
--with-system --with-iostreams --build-type=complete 

在命令行中被提出的,我导入项目的自述 - 仍然没有快乐。这是我为了构建MSVS解决方案而苦恼的一个CMake项目。

注:在CMake的GUI仔细看时,我的问题解决了:

enter image description here

我意识到,这是调试配置未建立果然,当我在“解决方案右侧点击“>配置管理器>更改为发布版本一切正常。仍然问题依然存在 - 我如何获得这些libboost_filesystem-vc120-mt- sgd -1_58.lib build?

回答

12

您需要在b2命令行参数中有runtime-link=static runtime-debugging=on variant=debug才能获得sgd

boost docs有关Windows库命名(特别是ABI标签部分):

ABI标签:编码影响图书馆与其他编译代码的互操作性的详细信息。对于每一个这样的特征,一个字母加入到标签:

Key | Use this library when:        | Boost.Build option 
===================================================================================== 
s | linking statically to the C++ standard library and | runtime-link=static 
    | compiler runtime support libraries.     | 
------------------------------------------------------------------------------------- 
g | using debug versions of the standard and runtime  | runtime-debugging=on 
    | support libraries.         | 
------------------------------------------------------------------------------------- 
y | using a special debug build of Python.    | python-debugging=on 
------------------------------------------------------------------------------------- 
d | building a debug version of your code.    | variant=debug 
------------------------------------------------------------------------------------- 
p | using the STLPort standard library rather than the | stdlib=stlport 
    | default one supplied with your compiler.    | 
+0

哇感谢 - 是'变种= release'和'变种= debug'独占?换句话说,在我的命令行上面添加'runtime-debugging = on variant = debug'就足够了(我已经有了'runtime-link = static') –

+1

我想如果你把'variant'完全抛出,调试和发布默认情况下。我也*认为*(不确定)它在构建调试版本时默认选择'runtime-debugging = on'。基本上,尝试运行你的原始命令没有'variant'标志。 – Fraser

+0

删除'variant'并确定已经存在'C:\ _ \ boost_1_58_0 \ stage \ lib \ libboost_filesystem-vc120-mt-sgd-1_58.lib C:\ _ \ boost_1_58_0 \ stage \ lib \ libboost_filesystem-vc120-sgd- 1_58.lib'被添加 - (比其他变体大4倍) - 关闭:) –

相关问题