title: Unresolved External Symbols in Proxy DLL
body: <p>I'm trying to build a proxy DLL for 'Version.dll' but keep running into errors related to the exported functions.</p>
  
  <pre><code>00000000 characteristics
  4A5BC9E3 time date stamp Tue Jul 14 05:27:23 2009
      0.00 version
         1 ordinal base
        15 number of functions
        15 number of names
  
  ordinal hint RVA      name
  
        1    0 00001B14 GetFileVersionInfoA
        2    1 00001E40 GetFileVersionInfoByHandle
        3    2 0000193C GetFileVersionInfoExW
        4    3 00001AB4 GetFileVersionInfoSizeA
        5    4 000014E8 GetFileVersionInfoSizeExW
        6    5 000015FC GetFileVersionInfoSizeW
        7    6 00001614 GetFileVersionInfoW
        8    7 00002820 VerFindFileA
        9    8 00003F50 VerFindFileW
       10    9 00002AF0 VerInstallFileA
       11    A 000043F8 VerInstallFileW
       12    B          VerLanguageNameA (forwarded to KERNEL32.VerLanguageNameA)
       13    C          VerLanguageNameW (forwarded to KERNEL32.VerLanguageNameW)
       14    D 00001B94 VerQueryValueA
       15    E 000015E0 VerQueryValueW
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>extern "C"
  {
      BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
      {
          if (dwReason == DLL_PROCESS_ATTACH)
          {
              DisableThreadLibraryCalls((HMODULE)hDllHandle);
  
              // do stuff
          }
  
          return TRUE;
      }
  
  DWORD APIENTRY Wrapper_GetFileVersionInfoSizeExA(__in DWORD dwFlags, __in LPCSTR lpwstrFilename, __out LPDWORD lpdwHandle)
      {
          return ::GetFileVersionInfoSizeExA(dwFlags, lpwstrFilename, lpdwHandle);
      }
  
  // and so on for the rest
  }
  </code></pre>
  
  <p>The exports definition file:</p>
  
  <pre><code>LIBRARY Version
  EXPORTS
  GetFileVersionInfoA=Wrapper_GetFileVersionInfoA
  GetFileVersionInfoByHandle=Wrapper_GetFileVersionInfoByHandle
  GetFileVersionInfoExW=Wrapper_GetFileVersionInfoExW
  GetFileVersionInfoSizeA=Wrapper_GetFileVersionInfoSizeA
  GetFileVersionInfoSizeExW=Wrapper_GetFileVersionInfoSizeExW
  GetFileVersionInfoSizeW=Wrapper_GetFileVersionInfoSizeW
  GetFileVersionInfoW=Wrapper_GetFileVersionInfoW
  VerFindFileA=Wrapper_VerFindFileA
  VerFindFileW=Wrapper_VerFindFileW
  VerInstallFileA=Wrapper_VerInstallFileA
  VerInstallFileW=Wrapper_VerInstallFileW
  VerLanguageNameA=Wrapper_VerLanguageNameA
  VerLanguageNameW=Wrapper_VerLanguageNameW
  VerQueryValueA=Wrapper_VerQueryValueA
  VerQueryValueW=Wrapper_VerQueryValueW
  </code></pre>
  
  <p>I'm using different function names to prevent prototype redefinition errors on including the Windows.h header file. Attempting to build the above generates the following errors:</p>
  
  <pre><code>1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoW@16
  1&gt;Main.obj : error LNK2001: unresolved external symbol _VerQueryValueA@16
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoSizeA@8
  1&gt;Main.obj : error LNK2001: unresolved external symbol _VerQueryValueW@16
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoSizeExW@12
  1&gt;Main.obj : error LNK2001: unresolved external symbol _VerInstallFileA@32
  1&gt;Main.obj : error LNK2001: unresolved external symbol _VerInstallFileW@32
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoA@16
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoExW@20
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoSizeW@8
  1&gt;Main.obj : error LNK2001: unresolved external symbol _VerFindFileW@32
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoSizeExA@12
  1&gt;Main.obj : error LNK2001: unresolved external symbol _GetFileVersionInfoExA@20
  </code></pre>
  
  <p>This is admittedly the first time I've attempted to build a proxy DLL, so I might be missing something obvious. Thanks.</p>