in reply to How to propagate C++ exceptions through XS
When C is compiled, the object file output references functions as they were in the source code, ie. foo(). However, in C++ the compiler will change the function name (munge it) to something else by adding characters to it, like foo_whatever(). As I understand it, this is related to supporting polymophism etc.
So, to call a 'C' function from C++ you have to keep the compiler from munging the 'C' function name by wrapping it in an extern "C" definition. Likewise, to call a C++ function from C.
Sorry, but I don't recall exact format as it's been too long since I have done any of this.
Here's a link I found that may be of use: C & CPP
Anyhow, I hope this helps.
|
|---|