title: Unresolved symbol errors within DLL
body: <p>For background, I have come across this porting a medium-sized linux codebase (compiling into a giant .so) to x64 windows (compiling into a .dll).  I have had linker trouble.</p>
  
  <p>As a minimal testcase, if I create a Visual Studio project from just the following file:</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;Dbghelp.h&gt;
  
  void do_stuff(char const * s)
  {
    char buffer[4096];
    long int len = UnDecorateSymbolName(
      s,
      buffer,
      sizeof(buffer),
      UNDNAME_COMPLETE);
  }
  </code></pre>
  
  <p>And I set the project type to DLL and build it, I get an error "LNK2001: Unresolved external symbol __imp_UnDecorateSymbolName".  That is, the file compiles properly, but fails to link into a dll.</p>
  
  <p>I think the goal is for my dll to link to dbghelp.dll, especially since (at least on my system) there is no such file as a dbghelp.lib.  So why is it trying to resolve that symbol now, rather then when my DLL is loaded into an application?  And why can't it see that function anyhow?</p>
  
  <p>To be clear, I have confirmed that I am building the x64 DLL, and that the dbghelp.dll in C:\Windows\System32 is x64.</p>