User forums > Using Code::Blocks

how to customize the functions name in dll

(1/1)

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.

Navigation

[0] Message Index

Go to full version