1
2
Jun 19 2014, 8:32 pm
|
|
I'm sorry but I don't quite understand what you're trying to tell me :o
|
In response to Lavitiz
|
|
Specifically it's about calling conventions, which without providing a several page course on how C/C++ linkers work, I think the DM reference for call() covers quite well.
Essentially in order to handle the fact you have more scopes, class names, virtual methods etc in C++, C++ takes whatever function name you provide, and mangles it to adhere to C identifier rules, required for linking with C code: http://en.wikipedia.org/wiki/ Name_mangling#Name_mangling_in_C.2B.2B As BYOND is calling the DLL you provide via dl*() on UNIX, or LoadLibrary() on Windows, BYOND doesn't have the full C++ symbol table the compiler sees, as it's a run-time only call (based on what you've put in the DMB). As such, it needs to call functions from your DLL, according to their post-mangled names. So you as a developer can either A. mangle the names yourself, and provide those mangled names in your DM code, or B. tell your C++ compiler to hand-off compilation and linking of the functions in question to the C dialect, where the names are not mangled. Given your DLL functions are /probably/ not class methods, method B just makes life easier for you. That is what extern "C" __declspec is doing. |
1
2