title: Want to create DEF file, TDUMP and IMPDEF show mangled names
body: <p>I have built Xerces-c_3_1.dll from source using the Visual Studio solution provided in the download package. It works with the sample applications that are part of that package (as long as they're built with VS).</p>
  
  <p>But I need to use the DLL with apps developed in C++ Builder 10 Seattle. The incompatible linkage and COFF-vs-OMF format issues (import lib) mean I need to tweak the build instructions. I <em>believe</em> I need to change the calling convention in the project properties from __cdecl to __stdcall, and add a DEF file to translate the exported functions for my environment.</p>
  
  <p>(I believe this because I wrote and support a DLL that is used by programmers writing in many languages. I do my development in C++ Builder [familiarity with the environment], and create the release version in VS Express 2015 [massive performance improvement over Embarcadero, I'm sorry to say]. Added a DEF file for just the 32-bit version [not needed for VC++ 64-bit, just to make me nuts], and it works for everybody.)</p>
  
  <p>Running TDUMP.exe on <em>my</em> DLL gets me output that looks like this:</p>
  
  <pre><code>EXPORT ord:0060='Edit_RunEdits'
  </code></pre>
  
  <p>Running <strong>tdump -ee xerces-c_3_1.dll >tdump.txt</strong> on the Xerces-c_3_1.dll built using __cdecl gets output like this:</p>
  
  <pre><code>EXPORT ord:1763='?Initialize@XMLPlatformUtils@xercesc_3_1@@SAXKKKQBD0QAVPanicHandler@2@QAVMemoryManager@2@@Z'
  EXPORT ord:1764='?Initialize@XMLPlatformUtils@xercesc_3_1@@SAXQBD0QAVPanicHandler@2@QAVMemoryManager@2@@Z'
  </code></pre>
  
  <p>Running <strong>impdef def.txt xerces-c_3_1.dll</strong> on the __cdecl build gets output like this:</p>
  
  <pre><code>?Initialize@XMLPlatformUtils@xercesc_3_1@@SAXKKKQBD0QAVPanicHandler@2@QAVMemoryManager@2@@Z @1763; ?Initialize@XMLPlatformUtils@xercesc_3_1@@SAXKKKQBD0QAVPanicHandler@2@QAVMemoryManager@2@@Z
  </code></pre>
  
  <p>Repeating TDUMP and IMPDEF on the __stdcall build gets similar results.</p>
  
  <p>And this is expected.</p>
  
  <p>But how can I create a DEF file from this noise? <strong>I would be perfectly happy with a sample of the format</strong> to use to turn "Initialize@XMLPlatformUtils" into something the linker can match to "XMLPlatformUtils::Initialize()" in my client app.</p>
  
  <p>By the way, I also used IMPLIB on both versions (__cdecl and __stdcall) to create an import library, which I added to my test project, but the linker continues to issue "unresolved external" errors for my calls to XMLPlatformUtils::Initialize and XMLPlatformUtils::Terminate. I believe <em>that</em> should be expected because of the name mangling.</p>