That's awesome. Thank you both for shedding the light on the role of the setup function. I should definitely read pd's source someday to get a deeper understanding.
And I want to say bravo for the actual state of the github organization by the way.
Best, Joseph
Le 04/06/18 à 15:21, IOhannes m zmoelnig a écrit :
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
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev