title: How do I build OpenSSL statically linked against Windows runtime?
body: <p>I'm working on a C++ application for Windows that uses OpenSSL 1.0.1e library. I'm on Visual Studio 2008.</p>
  
  <p>For portability reasons my application is statically linked against runtime libraries (<code>/MT</code> and <code>/MTd</code> options). And I don't ship runtime libs with my application.</p>
  
  <p>Per the <a href="http://www.openssl.org/support/faq.html" rel="noreferrer">OpenSSL FAQ</a>, the library is by default linked against multithreaded DLL runtime (<code>/MDd</code>) which is obviously incompatible with my scenario. So to make my program work I've added <code>applink.c</code> to my project. On my dev machine and on most test computers the program works fine.</p>
  
  <p>But unfortunately I've located computers where the app doesn't start. Windows displays error:</p>
  
  <pre><code>The application failed to initialize properly (0xc0150002). Click on OK to
  terminate the application. 
  </code></pre>
  
  <p>I've opened <code>libeay32.dll</code> in Dependency Walker and I see that <code>MSVCR90.dll</code> is not found. So the trick with <code>applink.c</code> doesn't really work for me. </p>
  
  <p>How do I build OpenSSL with <code>/MT</code> or <code>/MTd</code> option? </p>