title: How to link with static MFC libraries with the Microsoft Linker tool
body: <p>I am attempting to link my program with the static MFC libraries, as shown in the following target code in my makefile (the rest ommitted):</p>
  
  <pre><code>!include &lt;win32.mak&gt;
  
  all: window.exe
  
  .cpp.obj:
      $(cc) $(cdebug) $(cflags) $(cvars) $*.cpp   
  
  window.exe: window.obj
      $(link) $(ldebug) $(guiflags) -out:window.exe window.obj mfc100d.lib mfcs100d.lib $(winlibs)
  </code></pre>
  
  <p>Unfortunately, <code>nmake</code> halts the linking process and displays the following errors:</p>
  
  <ul>
  <li><p>nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator
  delete(void *)" (??3@YAXPAX@Z) already defined in
  mfc100d.lib(mfc100d.dll)</p></li>
  <li><p>LINK : warning LNK4098: defaultlib 'nafxcwd.lib' conflicts with use
  of other libs; use /NODEFAULTLIB:library</p></li>
  <li><p>mfcs100d.lib(appmodul.obj) : warning LNK4217: locally defined symbol
  __setmbcp imported in function "int __stdcall AfxInitialize(int,unsigned long)" (?AfxInitialize@@YGHHK@Z)</p></li>
  <li><p>window.exe : fatal error LNK1169: one or more multiply defined
  symbols found</p></li>
  </ul>
  
  <p>Besides telling the Microsoft Linking tool to ignore <code>nafxcwd.lib</code>, do I need to specify any additional library names or preprocessor definitions?</p>