title: Interesting LNK1104 error when using the static version of boost::filesystem
body: <p>I'm trying to test out some code which makes use of <code>boost::filesystem</code> for various things.<br/>
  I built the static version of boost 1.51 for vc11, and the intended libraries came out as expected.<br/></p>
  
  <p>Here are the flags I used:<br/>
  <code>b2 --with-filesystem --build-type=complete --build-dir=.\build link=static runtime-link=static</code>
  <br/></p>
  
  <p>And here's the list of files it generated:</p>
  
  <pre><code>libboost_filesystem-vc110-mt-s-1_51.lib
  libboost_filesystem-vc110-mt-sgd-1_51.lib
  libboost_filesystem-vc110-s-1_51.lib
  libboost_filesystem-vc110-sgd-1_51.lib
  libboost_system-vc110-mt-s-1_51.lib
  libboost_system-vc110-mt-sgd-1_51.lib
  libboost_system-vc110-s-1_51.lib
  libboost_system-vc110-sgd-1_51.lib
  </code></pre>
  
  <p><br/>
  I then created a new <strong><em>Win32 DLL</em></strong> project and added the proper include/lib directories.<br/>
  But when I try to compile, I get the following output:</p>
  
  <p><code>LNK1104: cannot open file 'libboost_filesystem-vc110-mt-gd-1_51.lib</code>
  <br/><br/>
  But this file does not exist because (afaik) it <em>IS NOT</em> the static version of the library...<br/>
  Which is odd because I never asked to link against the DLL version anywhere in my project!<br/></p>
  
  <p>So why is my project complaining about a library which I never asked to use?<br/>
  Do the boost headers automatically try to link against their corresponding libs?<br/>
  Is there some sort of preprocessor flag I should be setting to tell boost I want to use the static, single-threaded version of <code>boost::filesystem</code>?<br/>
  <br/></p>
  
  <h2><em>UPDATE:</em></h2>
  
  <p>I have been informed in the comments that boost <em>does</em> in fact try to auto-link for compilers which support it, via <code>&lt;boost/config/auto_link.hpp&gt;</code>...<br/>
  After several attempts to properly configure these headers to use the static, <code>/MDd</code> (debug) &amp; <code>/MD</code> (release) versions of boost, I am still getting this error.<br/><br/>
  So if anyone could tell me how to properly configure <em>OR</em> disable this feature, I will mark it as the answer.<br/>
  Also, am I correct in assuming that <code>libboost_filesystem-vc110-s-1_51.lib</code> and <code>libboost_filesystem-vc110-sgd-1_51.lib</code> are the proper <code>/MD</code> and <code>/MDd</code> libs?</p>
  
  <p>Thanks!</p>