I have this strangest behavior when subclassing StandaloneFilterWindow:
I get this linkage error:
juce_StandaloneFilterWindow.obj : error LNK2019: unresolved external symbol "public: virtual class juce::PropertySet * __thiscall StandaloneFilterWindow::getGlobalSettings(void)" (?getGlobalSettings@StandaloneFilterWindow@@UAEPAVPropertySet@juce@@XZ) referenced in function __catch$??0StandaloneFilterWindow@@QAE@ABVString@juce@@ABVColour@2@@Z$02
Jules, The reason for removing the singleton is that you don’t want to have a global reference to an object?
What is the alternative ? dependency injection? I have some singletons in my project and I think about what to do with them.
Singletons are just bad, and I’d rather not seem to be encouraging their use. If you have a shared object, the best way to manage it is to explicitly pass a pointer to it to any bits of code that need to access it, so that it’s not open for use/abuse by your whole codebase.
Ok ! So it seems that I found the problem !
you’re calling the pure virtual function in constructor of the class…
At line 66 of juce_StandaloneFilterWindow, you do : PropertySet* const globalSettings = getGlobalSettings();
In those particular cases, it seems that function is not yet defined by our heritage and that makes linker crazy.
I double check this and come back to give more technical explication.