title: Can I mix different Visual C++ runtimes with a static library?
body: <p>Regarding this Stack&nbsp;Overflow question: <em><a href="https://stackoverflow.com/questions/19944589/how-bad-is-it-to-mix-and-match-vc-runtime-dlls-in-one-process">How bad is it to mix and match Visual C++ runtime DLL files in one process?</a></em></p>
  
  <p>I know I can expect heap corruption by using a different version of MSVCR at runtime.</p>
  
  <p>But let's imagine the following situation that can't work:</p>
  
  <ul>
  <li><code>libA</code> is a shared library which links against <code>MSVCR71</code></li>
  <li><code>Exe</code> is my program that links against <code>libA</code> and <code>MSVCR100</code></li>
  </ul>
  
  <p>I have then the following dependency scheme:</p>
  
  <pre><code>Exe +--&gt; libA ---&gt; MSVCR71
      +--&gt; MSVCR100
  </code></pre>
  
  <p><strong>THAT is, the thing I KNOW I shouldn't do!</strong></p>
  
  <p>BUT what if now, I compile <code>libA</code> as a static library with whatever Visual Studio that uses <code>MSVCR71</code> and I compile my program, the <code>Exe</code>, with <code>libA</code> using a Visual Studio that uses <code>MSCVR100</code>.</p>
  
  <p>I will then have the following scheme:</p>
  
  <pre><code>Exe(lib A included) ---&gt; MSVCR100
  </code></pre>
  
  <p>Will the program (including the static lib) be linked well against <code>MSVC100</code> without any problem? Or can I expect an <strong>undefined behaviour</strong> because the header of the STL are susceptible to change between the <code>MSVCR71</code> and the <code>MSVC100</code>?</p>