Hi, does someone know whether something special has to be done in order to call C++ external functions using FFI? I know functions symbols are not the same for C and C++ libraries but I don't know what name I have to use to refer to a function. Thanks for your help.
I know functions symbols are not the same for C and C++ libraries but I don't know what name I have to use to refer to a function.
That depends on the C++ compiler you are using. Name-mangling is not standardized so different compilers have different ways of mangling the name. The best way to deal with it is to simply export the names you are interested in as
extern "C" { /* put declarations here */ }
which will avoid name mangling.
Cheers, - Andreas
Quoting Andreas Raab andreas.raab@gmx.de:
I know functions symbols are not the same for C and C++ libraries but I
don't
know what name I have to use to refer to a function.
That depends on the C++ compiler you are using. Name-mangling is not standardized so different compilers have different ways of mangling the name. The best way to deal with it is to simply export the names you are interested in as
extern "C" { /* put declarations here */ }
which will avoid name mangling.
Cheers,
- Andreas
Thank you very much!!
squeak-dev@lists.squeakfoundation.org