VC ++ prevents all decoration of character names

I am working on a DLL that will be used from another language (so there is no need to import libraries, including dll headers) using convstion _stdcall. The problem is that VC ++ always seems to do some name decoration on exported characters. All links that seem to say use extern "C", but that still leaves me with the leading underscore, and @ plus the number after the exported name.

The worst bit is the automated tool to load the .dll extension in the target language, essentially "func_name = GetProcAddress (dll," func_name "), so using the incomplete name GetProcAddress fails, and using the decorated name, it complains about the illegal name variable (@ not allowed): (

How can I get VC ++ to export somthing without any name decoration?

extern "C" __declspec(dllexport) int __stdcall test(int x, const char *str); 

dumpbin.exe

00011366 _test @ 8 = @ILT + 865 (_test @ 8)

+8
c ++ dll name-mangling stdcall
source share
1 answer

You can use the .def file. This will allow you to export functions without decorations.

Read: Exporting from DLL using DEF files

+6
source share

All Articles