Hi Chris and list,
well, I know that this nameclash exists. But I don't know what to do.... maxlib's scale is identical to the scale in Max (but scale is not a native Max object, I think) so it makes sense to keep it's name for compatibility reasons. On the other hand Gem's scale has been introduced earlier and is used in quite a lot of patches, I guess.
I could add an option to maxlib that would prepend all the object names with 'maxlib_' to avoid nameclashes. But this could only be included during compilation and would produce quite long object names. And leaving it an option one would need to know which version was used for a patch before being able to open it.
The problem we're facing here is not the only one where nameclashes occur. On thursday Eric Skogen posted a mail to the list asking for help with a similar problems. I'll also post this mail to the pd list since we had this discussion several times but never really got to a definite solution, I think. Or did I miss anything?
Olaf
PS: the error message is OS X only, Linux and Win just ignore the second definition and create the object that has been loaded first... maybe there is an option that can be set to ignore this error and to force the behaviour found on Linux?
chris clepper schrieb:
Hi Olaf
I was just talking to a Gem beta tester who mentioned that there is a multiple definition of symbol _scale_setup when using both Gem and maxlib. Maxlib seems way too useful to have to choose between it and Gem. Has this been brought up before??
errors:
/pd/bin/pd multiple definitions of symbol _scale_setup Gem.pd_darwin definition of _scale_setup maxlib.pd_darwin definition of _scale_setup
cgc
Olaf Matthes said this at Fri, 7 Feb 2003 12:25:34 +0100:
PS: the error message is OS X only, Linux and Win just ignore the second definition and create the object that has been loaded first... maybe there is an option that can be set to ignore this error and to force the behaviour found on Linux?
This option is the default in the CVS devel_0_36 branch, AKA Adam's "Pd extended" install. The error is normally a crasher, right?
I haven't the resources to test it completely, but the behaviour I have observed is that using the NSLINKMODULE_OPTION_PRIVATE in s_loader.c pretty much emulates the linux behaviour: the second definition is ignored.
Please let me know if this is not the case.
Cheers, adam
Hi and sorry for the self reply,
I just had an idea how to solve (or 'work around') nameclashes. I'm not a fan of having objects like [maxlib_scale] because it needs a lot of typing, but what about something like this:
void maxlib_scale_setup(void) { scale_class = class_new(gensym("maxlib_scale"), [....] class_addcreator((t_newmethod)value_new, gensym("scale"), A_DEFSYM, 0); [...]
The 'normal' object name would then be 'maxlib_scale' but 'scale' would also work. In case Gem would define it's scale as 'gem_scale' with the optional 'scale' name one could use 'scale' as long as there is just one of the libraries loaded and change to 'maxlib_scale' / 'gem_scale' in case both are used... ?!
Haven't tested it yet... would it work? Would Pd accept to have two (nearly) identical class_addcreator calls?
Olaf
hi,
this is basically an explicit way of achieving what IOhannes proposed some time ago. The problem is that nobody without gem installed would ever write 'maxlib.scale' -- so patches still remain nonportable. The solution is either for Pd to store lib names in a patch file (thus implicitly declaring patch dependencies), or for the external writers to simply avoid name clashes in the first place.
Krzysztof
Olaf Matthes wrote: ...
I just had an idea how to solve (or 'work around') nameclashes. I'm not a fan
..
The 'normal' object name would then be 'maxlib_scale' but 'scale' would also work. In case Gem would define it's scale as 'gem_scale' with the optional