【问题标题】:Visual Studio 2017, "Mixing a dll boost library with a static runtime", when linking python_boost.lib链接 python_boost.lib 时,Visual Studio 2017,“将 dll boost 库与静态运行时混合”
【发布时间】:2017-07-10 21:55:59
【问题描述】:

我正在尝试构建适用于 Windows 10 的 BGSLibrary,cmake 3.9,支持 python,使用 opencv 3.1 构建,并使用 Visual Studio Community 2017 提升 1.64.0。

我使用 python 库 (.lib) 和 STATIC 运行时 (link=static) 构建了 boost。

b2 -j%cores% toolset=%msvcver% address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64 --with-python

但 CMAKE 无法找到它们。它想要 python_boost.lib 形式的东西。所以我将 .lib 复制到一个新文件夹并将其指向 PATH。请参阅我的最后一个问题。 https://stackoverflow.com/questions/45002215/point-findboost-cmake-to-boost-python-windows-10-vs-2017/45002971#45002971

现在我得到了很多debated

1>C:\Program Files\boost_1_64_0\boost/config/auto_link.hpp(370): fatal error C1189: #error:  "Mixing a dll boost library with a static runtime is a really bad idea..."

谁能帮我解开这个。我觉得很混乱。

  1. boost 库不是共享的 .dll,它是 boost_python.lib!混合一个 dll boost 库?它不是一个 dll boost 库。 CMAKE 清楚地看到了,从 Cmake 输出

    提升库状态:

    版本:106400

    库:C:/Program Files/boost_1_64_0/stage/lib/boost_python.lib

    包含路径:C:/Program Files/boost_1_64_0

  2. 另外,Visual Studio 运行时不是静态的吗?当我查看运行时,没有静态选项。

是不是我从 boost boostrap 重命名了错误的 .lib?这是我的选项(64 位也有,在不同的文件夹中)

具体来说,我应该将哪些文件重命名为 python_boost?扩展名应该是什么?为了以防万一,我返回并在引导程序中使用 .dll 支持重新制作,但 cmake 不会生成 .dll。我觉得我在这里明显遗漏了一些东西。

编辑:

libbgs 的Visual Studio 属性,明明是想制作一个.so 静态库,为什么抱怨它是动态的?

【问题讨论】:

  • 请发表评论而不是投反对票。我可以做些什么来改善这个问题?

标签: python c++ boost visual-studio-2017


【解决方案1】:

我能够通过像构建 boost.python 来解决这个错误

b2 -j%cores% toolset=%msvcver% address-model=32 architecture=x86 link=static threading=multi runtime-link=static --build-type=complete stage --with-python

【讨论】:

    猜你喜欢
    • 2012-03-20
    • 2013-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-07
    • 2012-03-30
    • 1970-01-01
    相关资源
    最近更新 更多