title: Visual Studio - error LNK2005 in debug mode
body: <p>I'm integrating 3rd party code into my MFC app under Visual Studio 2010.<br>When in Debug mode the following build error occurs:</p>
  
  <pre><code>1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in libcmtd.lib(invarg.obj)
  1&gt;LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in libcmtd.lib(invarg.obj)
  1&gt;LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
  1&gt;D:\My Documents\Dev\MyProject\MyProject\Debug\MyProject.exe : fatal error LNK1169: one or more multiply defined symbols found
  </code></pre>
  
  <p>Using <a href="http://www.codeguru.com/forum/archive/index.php/t-388680.html" rel="noreferrer">this advice</a> I was able to complete the build in two ways:</p>
  
  <ul>
  <li>In Release mode</li>
  <li>In Debug mode using /FORCE:MULTIPLE as an additional linker command line option</li>
  </ul>
  
  <p>In the second case (Debug mode) many warnings are still reported. If I also add /NODEFAULTLIB:LIBCMT most of them are gone.</p>
  
  <p>What is the cause of this?<br>
  How can I solve this, instead of working around it?<br></p>