JUCE_ObjCExtraSuffix question


#1

I have situatuin where part of my plugin is linked to a static library (a small framework i created), both the static library and the plugin use JUCE. I understand that i have to re-build JUCE (amalgamated) each time i rebuild the plugin. I use a singleton in my static library. DO i need to apply the same workaround for class naming in that library ? Will this cause issues later on, so far i’m unable to load the same plugin instance twice. I have a lot of different plugins that use the same static library, i can load inly one into Live. Reaper seems to be handling this much better and causes no issues. What is the best way to do this, shoul i perhaps add the code of the static library to each plugin project and rebuld (will it help?), will the Singleton be a problem?


#2

Well, yes, if you’ve got a static lib that has juce inside it, then it’ll contain obj-c classes, and those will need to have unique names. Unless you can find a way to make the linker use your lib internally without exposing all its obj-c classes to the outside world, but I don’t think that’s really how obj-c works.

If I were you I’d just pull your library into the plugin as source-code rather than as a lib - it just makes the whole thing so much less complicated.


#3

I’ll do that.

I have a more general question, what does JUCE_ObjCExtraSuffix actually do, i saw in the source it uses some sort of a Macro definition, i was wondering does this affect my JUCE classes or just you obj-c code, also what format is it, it never says really should it be a number a string or what? Also can i define it as a global define for a project and not set it in my include files, will this work (i use per project settings, and the include files are the same so it would be stupid to add this prefix to the include files)


#4

It’s used to create the names of all the obj-c classes that are used internally in Juce. You could indeed use a global define - it’ll work as long as the amalgamated files have the definition set.