Tech Support > Microsoft Windows > Development Resources > Compiling DLLs with name mangled names
Compiling DLLs with name mangled names
Posted by Testor on January 16th, 2007


I'm trying to write a wrapper to jvm.dll, but I can't keep the compiler
from demangling the names of the exported functions.
I have a jvm.def file with the name mangled names that I want:

EXPORTS
??_7ASPSOldGenff@6B@=__E__0__ @1
??_7ASPSYoungGen6B@=__E__1__ @2
....

And a jvm.cpp with function stubs with this signatures:

extern "C" __declspec(naked) void __stdcall __E__0__()
....

After compiling and linking the names of the exported functions are
demangled. How can I compile the dll without demangling the names?

My compiler and linker options:

CL.EXE /O2 /GL /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL"
/FD /EHsc /MT /Fo".\jvm.cpp.obj" /Fd".\vc80.pdb" /W3 /nologo /c /Wp64
/TP /errorReportrompt jvm.cpp

LINK.EXE /OUT:"jvm.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST
/DEF:"jvm.def" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /MACHINE:X86
/ERRORREPORT:PROMPT jvm.cpp.obj kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Posted by Scot Brennecke on January 16th, 2007


It's that extern "C" thing that compiles the function signature as a C
function, instead of C++

"Testor" <t3st0re@gmail.com> wrote in message
news:1168957074.509162.72150@38g2000cwa.googlegrou ps.com...


Posted by Testor on January 16th, 2007



Scot Brennecke wrote:
That's what I thought too, but after trying compiling the dll without
the extern "C" directive, the results are still the same.



Similar Posts