2> LINK:致命错误LNK1104:无法打开文件'libboost_filesystem-vc120-mt-sgd-1_58.lib'

Mr_*_*s_D 6 boost cmake msvc12

难怪因为没有这样的文件...\boost_1_58_0\stage\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
Run Code Online (Sandbox Code Playgroud)

在那里.尝试使用各种选项进行编译提升 --build-type=complete(最终解决它的问题)(链接器错误LNK1104中的"穷人"解决方案与'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
Run Code Online (Sandbox Code Playgroud)

在我正在导入的项目的自述文件中建议的命令行 - 仍然没有乐趣.这是一个CMake项目我为构建MSVS解决方案付出了一些努力.

注意:仔细观察CMake gui时我的问题解决了:

在此输入图像描述

我意识到,当我右键单击"解决方案">配置管理器>更改为发布版本时,调试配置无法构建且确定无误.问题仍然存在 - 我如何获得libboost_filesystem-vc120-mt- sgd -1_58.lib构建?

Fra*_*ser 12

你需要runtime-link=static runtime-debugging=on variant=debug在b2命令行args中获取sgd.

从有关Windows上库命名的boost文档(特别是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.              |
Run Code Online (Sandbox Code Playgroud)