I’m trying to instantiate a Singleton pattern GUI overhead. I stumbled upon the included Singleton ( https://www.juce.com/doc/juce__Singleton_8h ) and am trying to get it to work.
I’ve admittedly not done much with macros or pre-processor definitions, so most of this seems like witchcraft to me. I’ve been trying things and hoping that they’ll work, without a fundamental understanding of what’s going on.
Both explanations of what I need to do to complete this code, and what’s actually going on, would be very much appreciated! Resources/reading material are also appreciated.
Currently, I’m getting a
Redefinition of _singletonInstance error in my macro definition in the ISWGUI header. Here’s my barebones code just trying to get the Singleton able to be instantiated (without any other methods for it yet)
//JUCEy Singleton Wizardry
//true bool ensures deletion in PluginProcessor releaseResources holds
//Macro for Singleton
endif // ISWGUI_H_INCLUDED
#include "ISWGUI.h" juce_ImplementSingleton(ISWGUI)
that last line is giving me my error.