title: How to circumvent LNK2005/LNK2006 (duplicate symbol)?
body: <p>I have a situation where I have to link with two object files (for which I don't have the source code) that unfortunately duplicately defines symbols. I wonder if there's a reasonable way to circumvent this problem?</p>
  
  <p>In <a href="https://stackoverflow.com/questions/4085050/how-to-ignore-lnk2005-lnk1169">another question</a> there were the suggestion to use <code>/FORCE</code> to produce output anyway, however it was also mentioned that the use of <code>/FORCE</code> means that one have little control over the situation. Not only is which of the symbols to be used undefined it also would mean that unintentionally duplicate symbols would pass silently (which is likely to be an error).</p>
  
  <p>What I would like is to tell the linker that I know that <code>foo</code> is defined in both <code>bar.obj</code> and <code>baz.obj</code> and it's supposed to disregard the one found in <code>baz.obj</code>. This way it should diagnose as an error if I were to define <code>qux</code> at two places in the codebase or even if I happen to accidently define <code>foo</code> in some other object file.</p>