title: Get reason that LoadLibrary cannot load DLL
body: <p>On Linux and Mac, when using <code>dlopen()</code> to load a shared library that links to another library, if linking fails because of a missing symbol, you can get the name of the missing symbol with <code>dlerror()</code>. It says something like</p>
  
  <pre><code>dlopen failed: cannot locate symbol "foo"
  </code></pre>
  
  <p>On Windows, when using <code>LoadLibrary()</code> to load a DLL with a missing symbol, you can only get an error code from <code>GetLastError()</code> which for this type of issue will always be 127. How can I figure out which symbol is missing, or a more verbose error message from <code>LoadLibrary()</code> that explains why the function failed?</p>