Author Topic: how to customize the functions name in dll  (Read 3918 times)

reasoner

  • Guest
how to customize the functions name in dll
« on: November 09, 2007, 06:31:41 pm »
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.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: how to customize the functions name in dll
« Reply #1 on: November 09, 2007, 09:27:25 pm »
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.