简体   繁体   English

链接python_boost.lib时,Visual Studio 2017“与静态运行时混合DLL Boost库”

[英]Visual Studio 2017, “Mixing a dll boost library with a static runtime”, when linking python_boost.lib

I am trying to build the BGSLibrary for Windows 10, cmake 3.9, with python support, built with opencv 3.1 and boost 1.64.0 with Visual Studio Community 2017. 我正在尝试为Windows 10构建cms 3.9的BGSLibrary,具有python支持,由opencv 3.1构建,并在Visual Studio Community 2017中提升1.64.0。

I built boost with python libraries (.lib) and a STATIC runtime (link=static). 我使用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

but CMAKE was having trouble finding them. 但是CMAKE找不到他们。 It wanted something in the form of python_boost.lib. 它需要python_boost.lib形式的内容。 So I copied a .lib to a new folder and pointed it in PATH. 因此,我将一个.lib复制到一个新文件夹,并将其指向PATH。 See my last question. 看到我的最后一个问题。 https://stackoverflow.com/questions/45002215/point-findboost-cmake-to-boost-python-windows-10-vs-2017/45002971#45002971 https://stackoverflow.com/questions/45002215/point-findboost-cmake-to-boost-python-windows-10-vs-2017/45002971#45002971

Now I get the much 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..."

Can someone unpack this for me. 有人可以帮我打开包装。 I find it confusing. 我感到困惑。

  1. The boost library is not a shared .dll, it is boost_python.lib! boost库不是共享的.dll,而是boost_python.lib! Mixing a dll boost library? 混合DLL Boost库? its not a dll boost library. 它不是DLL Boost库。 CMAKE clearly sees it, from Cmake output CMAKE从Cmake输出清晰可见

    Boost library status: 提升库状态:

    version: 106400 版本:106400

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

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

  2. Plus, the Visual Studio runtime is not static? 另外,Visual Studio运行时不是静态的吗? When I look at the runtime, there is no static option. 当我查看运行时时,没有静态选项。

在此处输入图片说明

Is it that I renamed the wrong .lib from boost boostrap? 是我从boost boostrap重命名了错误的.lib吗? Here were my options (64 bit is there too, in a different folder) 这是我的选择(在其他文件夹中也有64位)

Specifically, which of these files should I rename python_boost? 具体来说,我应将以下哪个文件重命名为python_boost? And what should the extension be? 扩展名应该是什么? I went back and remade with .dll support in bootstrap just in case, but cmake won't take .dll to generate. 我回过头来在引导程序中使用.dll支持进行了重新制作,以防万一,但是cmake不会使用.dll来生成。 I feel like i'm missing something obviously here. 我觉得我在这里显然缺少什么。

在此处输入图片说明

EDIT: 编辑:

Visual Studio properties for libbgs, clearly trying to make a .so static library, why does it complain that its dynamic? libbgs的Visual Studio属性,显然试图创建一个.so静态库,为什么它抱怨它是动态的?

在此处输入图片说明

我能够通过构建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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM