Hi,
I'm building a simple dll and have a small Problem which is probably more a mingw than a CB problem. The DLL exports a function:
bool DistributeValue(int *pValues)
which is exported automatically as
_Z15DistributeValuePi
In VisualC++ its enough to place a def file with the alias in the source folder
EXPORTS
DistributeValue
With mingw/CB this is obviously not. What will I have to do to export the function with a name I want?
Env: WinXP, CB1.0 (31.08.06), mingw32 3.4.4
Try adding -Wl,--add-stdcall-alias in the linker options for gcc to make it for you.
Alternatively, you can create a def file and add the linker option -Wl,--def [your_def] (IIRC).
Hm, neither the first nor the second method has an effect to the exported symbols in my dll... :?
if you want to build a dll with import names, that are consistent between different compilers, you need
to build it as C code, which then uses the C naming conventions.
use
#ifdef __cplusplus
extern "C"
{
#endif
.... // here are your exported function names
#ifdef __cplusplus
}
#endif
infos
http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html
her is a small project which demonstrates the differences
look at the generated .def files for name mangling info
HTH, tiwag
[attachment deleted by admin]
http://wyw.dcweb.cn/stdcall.htm