DLL function names using dumpbin.exe

I wrote a .dll library with many functions and classes in visual studio 2010. When I view the contents of a file with:

dumpbin.exe /EXPORTS myDll.dll 

I get long function names with some kind of function location pointer that looks like this (second entry in .dll):

  2 1 0001100A ?Initialize@codec @ codecX@ @ SANNN@Z = @ILT+5( ?Initialize@codec @ codecX@ @ SANNN@Z ) 

It is somehow difficult to read, but I saw a "more convenient" list of procedures / functions from other .dll-s, for example:

 141 8C 00002A08 PogoDbWriteValueProbeInfo 

How can I make this .dll list this way?

PS: the source code of my dll is as follows:

 namespace codecX { class codec { public: static __declspec(dllexport) double Initialize(double a, double b); ... 
+6
source share
2 answers

You need to pull these static member functions into the global address space, and then wrap them extern with "C". This will suppress the C ++ name crash and instead give you the least ugliness:

 extern "C" __declspec(dllexport) Initialize(double a, double b) { codec::Initialize(a, b); } 

and then remove __declspec (dllexport) for your static member functions:

 class codec { public: static double Initialize(double a, double b); } 
+7
source

This is called name-mangling and occurs when compiling C ++ with the C ++ compiler. To preserve the "readable" names, you will need to use extern "C" when declaring and defining your classes and your functions. i.e.

 extern "C" void myFunction(int, int); 

See here as well as google mixing C and C++ .

+3
source

All Articles