title: How to link Boost in a dependent static library
body: <p>In MS Visual C++ 2010</p>
  
  <p>I had a single C++ project in my solution which used boost and worked perfectly. </p>
  
  <p>I then decided to convert this project into a static library and create a new project which depends on this static library. </p>
  
  <p>Now, my converted static library builds without errors and warnings (compiler and linker)
  but the new project compiles but does not link. </p>
  
  <p>I am getting:</p>
  
  <pre><code>1&gt;LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-1_45.lib'
  </code></pre>
  
  <p>As a test I added the full directory path to the linker options for this library... and then it complained about</p>
  
  <pre><code>1&gt;LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-1_45.lib'
  </code></pre>
  
  <p>I have now added complete paths to all the libraries and it now builds and run.</p>
  
  <p>I am not happy with this solution because:</p>
  
  <ol>
  <li>I don't want users of the library to
  have to worry about linking in
  boost. </li>
  <li>It is messy</li>
  </ol>
  
  <p>I know an answer would be to create a DLL but is there a way to do this statically and keep the linking at my static library level.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>If I tell the .exe linker to ignore the boost libs explicitly then it all is ok except the .exe should not have to worry about boost at all. </p>
  
  <pre><code>/NODEFAULTLIB:"libboost_thread-vc100-mt-1_45.lib" /NODEFAULTLIB:"libboost_date_time-vc100-mt-1_45.lib"
  </code></pre>