title: Visual Studio 2017, "Mixing a dll boost library with a static runtime", when linking python_boost.lib
body: <p>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.</p>
  
  <p>I built boost with python libraries (.lib) and a STATIC runtime (link=static).</p>
  
  <pre><code>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
  </code></pre>
  
  <p>but CMAKE was having trouble finding them. It wanted something in the form of python_boost.lib. So I copied a .lib to a new folder and pointed it in PATH. See my last question.
  <a href="http://[https://stackoverflow.com/questions/45002215/point-findboost-cmake-to-boost-python-windows-10-vs-2017/45002971#45002971][1]" rel="nofollow noreferrer">https://stackoverflow.com/questions/45002215/point-findboost-cmake-to-boost-python-windows-10-vs-2017/45002971#45002971</a></p>
  
  <p>Now I get the much <a href="https://stackoverflow.com/questions/9527713/mixing-a-dll-boost-library-with-a-static-runtime-is-a-really-bad-idea">debated</a> </p>
  
  <pre><code>1&gt;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..."
  </code></pre>
  
  <p>Can someone unpack this for me. I find it confusing.</p>
  
  <ol>
  <li><p>The boost library is not a shared .dll, it is boost_python.lib! Mixing a dll boost library? its not a dll boost library. CMAKE clearly sees it, from Cmake output</p>
  
  <p>Boost library status:</p>
  
  <p>version: 106400</p>
  
  <p><strong>libraries: C:/Program Files/boost_1_64_0/stage/lib/boost_python.lib</strong></p>
  
  <p>include path: C:/Program Files/boost_1_64_0</p></li>
  <li><p>Plus, the Visual Studio runtime is not static? When I look at the runtime, there is no static option.</p></li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/wp0Zm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wp0Zm.png" alt="enter image description here"></a></p>
  
  <p>Is it that I renamed the wrong .lib from boost boostrap? Here were my options (64 bit is there too, in a different folder)</p>
  
  <p>Specifically, which of these files should I rename 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. I feel like i'm missing something obviously here.</p>
  
  <p><a href="https://i.stack.imgur.com/9E97t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9E97t.png" alt="enter image description here"></a></p>
  
  <p>EDIT:</p>
  
  <p>Visual Studio properties for libbgs, clearly trying to make a .so static library, why does it complain that its dynamic?</p>
  
  <p><a href="https://i.stack.imgur.com/a21cu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a21cu.png" alt="enter image description here"></a></p>