News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

how to customize the functions name in dll

Started by reasoner, November 09, 2007, 06:31:41 PM

Previous topic - Next topic

reasoner

under ms windows xp
i built a simplest dll file with C::B, which has only one ex funtion "SomeFunction".
after building, i got a .dll file and a .def file.
the content of the .def file:

EXPORTS
    _Z12SomeFunctionPKc @1

_Z12SomeFunctionPKc is the function name of "SomeFunction" in the dll.
how can i customise the function name? for example i would like name it just as "SomeFunction".

THANK YOU VERY MUCH.

Ceniza

The function name becomes like that because of Name mangling, which is something C++ does. If you want to remove all of that then you must compile it as C code, or use extern "C" in C++ code.