title: linking error: ambiguous libboost*.lib vs boost*.lib
body: <p>I'm using boost in my project. I've downloaded pre-compiled binaries from here <a href="http://boost.teeks99.com/" rel="nofollow noreferrer">http://boost.teeks99.com/</a></p>
  
  <p>When linking I receive such error:</p>
  
  <p><code>Error  18  error LNK2005: "public: void __cdecl boost::thread::join(void)" (?join@thread@boost@@QEAAXXZ) already defined in boost_thread-vc110-mt-1_52.lib(boost_thread-vc110-mt-1_52.dll) C:\Oleg\projects\MBClient\FastNativeAdapter\libboost_thread-vc110-mt-1_52.lib(thread.obj)   FastNativeAdapter</code></p>
  
  <p>Why boost contains two <code>lib</code> with so similar name, what is the difference between them?</p>
  
  <ul>
  <li>libboost_thread-vc110-mt-1_52.lib</li>
  <li>boost_thread-vc110-mt-1_52.lib</li>
  </ul>
  
  <p>How to fix linking error?</p>
  
  <p><strong>upd</strong> I've compiled boost myself. I've added <code>boost_1_53_0\stage\lib</code> directory to linker. This directory actually contains 3 "copies" of "each" file, for example:</p>
  
  <ul>
  <li>boost_atomic-vc110-mt-1_53.dll</li>
  <li>boost_atomic-vc110-mt-1_53.lib</li>
  <li>libboost_atomic-vc110-mt-1_53.lib</li>
  </ul>
  
  <p>So It's clear what compiler claims about. Somehow it can't understand which version of lib file to use. It's likely connected with static/dinamic linking, but I still can not find the solution. I'm sure my problems is pretty common so I hope someone can suggest me what to do.</p>
  
  <p>I've tried to delete all "libboost*" files from folder but then I receive such error:
  <code>Error  15  error LNK1104: cannot open file 'libboost_date_time-vc110-mt-1_53.lib'</code></p>
  
  <p>I've tried to delete all "boost*lib" files from folder but then I receive such error:
  <code>Error  15  error LNK1104: cannot open file 'boost_thread-vc110-mt-1_53.lib'</code></p>
  
  <p>Then I copied <code>boost_thread-vc110-mt-1_53.lib</code> back and I receive a lot of errors like that:</p>
  
  <p><code>Error  16  error LNK2005: "public: virtual __cdecl boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_base@detail@boost@@UEAA@XZ) already defined in boost_thread-vc110-mt-1_53.lib(boost_thread-vc110-mt-1_53.dll)</code></p>
  
  <p>So when there are no <code>boost_thread-vc110-mt-1_53.lib</code> compiler claims that it's missing, when there is <code>boost_thread-vc110-mt-1_53.lib</code> compiler claims that "function is already defined". Probaly somehow I do use dinamic and static linking at the same time or something like that?</p>
  
  <p><strong>upd2</strong> i've uncommented <code>#define BOOST_ALL_DYN_LINK</code> as suggested <a href="https://stackoverflow.com/questions/2520234/how-to-link-to-dynamic-boost-libs/3051417#3051417">here</a> and now code compiles! i'm investigating if everything else is fine. however i didn't understand why I should uncomment <code>#define BOOST_ALL_DYN_LINK</code> so comments are welcome.</p>