[PD-dev] pd external c++ example

IOhannes m zmoelnig zmoelnig at iem.at
Mon Jun 4 15:21:48 CEST 2018


On 2018-06-04 13:05, Joseph Larralde wrote:
> And as you said, it compiles with extern "C" surrounding only the setup
> function.
> In fact it even compiles without any extern "C" at all (but won't load,
> probably due to name mangling).

yes.
you only need the 'extern "C" {}' clause to prevent name-mangling.
the (unmangled) name is only important for Pd to find the setup function
(the setup-function must be a well-known name that can be calculated
from the library name).

so in order for Pd to bootstrap your library, you must make sure to
prohibit name-mangling by protecting the entry-points with 'extern "C"'.
as Pd doesn't need to resolve the name of the rest, you don't have to
protect it.


fgasdrm
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20180604/f203ca09/attachment.sig>


More information about the Pd-dev mailing list