title: WinMain exported from a DLL
body: <p>I am trying to hide the WinMain function inside a DLL in order to avoid typing again much of the code over and over again.</p>
  
  <p>I exported wWinMain from the DLL by declaring it as</p>
  
  <p><code>
  extern "C" int WINAPI wWinMain( ... )
  {
      // repetitive code here
  }
  </code></p>
  
  <p>and used the linker option <code>/EXPORT:wWinMain</code>, but when I try to use the import library in another project I get the error</p>
  
  <p><code>
  LIBCMTD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _<em>WinMain@16 referenced in function _</em>_tmainCRTStartup
  </code></p>
  
  <p>Remark <em>I do want to use the GUI interface</em> and I know this is common error when you define a main instead of a WinMain function. Also, I enabled the UNICODE support in both projects. What should I do?</p>