title: LNK 2005 in Visual C++ in Visual Studio 2010
body: <p>I'm trying to compile a C++ program, written using Visual C++ 2005 and MFC, in MS VS 2010. Sadly I'm getting the following error during compilation:</p>
  
  <pre><code>Error 2 error LNK2005: "public: virtual __thiscall CMemDC::~CMemDC(void)" (??1CMemDC@@UAE@XZ) already defined in CMemDCImpl.obj Project\Project\Project\uafxcwd.lib(afxglobals.obj) Project.
  </code></pre>
  
  <p>CMemDCImpl has a header file which contains definitions of all members of the class CMemDCImpl, and *.cpp file with their implementations. Please help me to fix this error. </p>