M
Mohammad Omer
I am writing code for creating DLL using vs2k5. My project is using
Crypto++ lib project, which has a function (ComputeHash), and with the
same name of function I have written in project with a little bit
change as follows
Crypto++ function:
protected: unsigned int __thiscall
CryptoPP:eflator::ComputeHash(unsigned char const *)const
My function:
unsigned char * __stdcall ComputeHash(char *)
For exporting function I am using "__declspec(dllexport)", by using
declspec my exported functions will be name mangled (right??) and if I
do a function over loading of the same function, it also works fine.
If I want to export functions with out name mangling, using def file it
result in a link error. My understanding is that error comes because
over loading is not allowed using unmangled exported function, is that
right?
But, if I use
extern "C" unsigned char * __stdcall ComputeHash(char *)
Name mangling will be removed against this function extern "C" will
be the part of function signatures. If I have two functions, they
overload each other and wants to export these functions with out name
mangling the question is how to full fill this need? I seen that if one
function exported by def and other function exported by using extern
"C", both will be export successfully and will not be name mangled.
My first question, what is the difference of exporting function by
using extern "C" and def files?
Regards,
-aims
Crypto++ lib project, which has a function (ComputeHash), and with the
same name of function I have written in project with a little bit
change as follows
Crypto++ function:
protected: unsigned int __thiscall
CryptoPP:eflator::ComputeHash(unsigned char const *)const
My function:
unsigned char * __stdcall ComputeHash(char *)
For exporting function I am using "__declspec(dllexport)", by using
declspec my exported functions will be name mangled (right??) and if I
do a function over loading of the same function, it also works fine.
If I want to export functions with out name mangling, using def file it
result in a link error. My understanding is that error comes because
over loading is not allowed using unmangled exported function, is that
right?
But, if I use
extern "C" unsigned char * __stdcall ComputeHash(char *)
Name mangling will be removed against this function extern "C" will
be the part of function signatures. If I have two functions, they
overload each other and wants to export these functions with out name
mangling the question is how to full fill this need? I seen that if one
function exported by def and other function exported by using extern
"C", both will be export successfully and will not be name mangled.
My first question, what is the difference of exporting function by
using extern "C" and def files?
Regards,
-aims