title: Linker error 2005, 2001 in Visual Studio 2008
body: <p>I have a ATL COM project that was compiling fine in VC6 which gives the following linker errors when compiled in VS2008.</p>
  
  <blockquote>
    <p>error LNK2005: "void * __cdecl
    operator new(unsigned int)"
    (??2@YAPAXI@Z) already defined in
    libcmt.lib(new.obj)   File: uafxcw.lib</p>
  </blockquote>
  
  <p>There are three more similar errors for <code>delete</code>, <code>new[]</code> and <code>delete[]</code>.</p>
  
  <p>I checked out several articles on the net and most of them say that its a conflict between CRT and MFC dlls. (Order in which they are picked up). One article suggests adding the conflicting lib to the ignore lib list in project settings.</p>
  
  <p>Doing so, I am left with one error:</p>
  
  <blockquote>
    <p>error LNK2001: unresolved external
    symbol __afxForceEXCLUDE  File:LMAN.Lib</p>
  </blockquote>
  
  <p>The error points to a lib that is referenced by this project (a lib developed by us).</p>
  
  <p>Any ideas on how to fix this? I am sure this would be a common problem for people doing migration to VS 2008.</p>