How to force simple function naming in dll?

Hello, I'm writing a dll and there's one thing that bothers me. For example if I have function for dynamic linking
1
2
3
4
__declspec(dllexport) void my_function(void*)
{
// ...
}

to call this function from a program I must know its "export". The problem that really bothers me is that linker gives strange names for functions, eg.: _Z8my_functionPv instead of my_function. Maybe there's a way to prevent compiler/linker from doing that?
Thanks for help.
closed account (z05DSL3A)
extern "C" may be what you are looking for. e.g.
1
2
3
4
5
6
7
8
9
10
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif

EXPORT void my_function(void*)
{
// ...
}

Thanks!
Topic archived. No new replies allowed.