I’m setting up a CMake based project that contains a plugin target, added via juce_add_plugin
and a standalone application, added via juce_add_gui_app
. The standalone application should integrate the plugin, so I simply tried linking against it like:
target_link_libraries (my_standalone
PUBLIC
juce::juce_gui_extra
PRIVATE
my_plugin)
The standalone code then calls createPluginFilter()
to instantiate the plugin. This worked well until we enabled ARA for the plugin. While building e.g. the VST3 target for the plugin still works as expected and produces a running ARA enabled VST3 plugin, compiling the standalone target now fails with these linker errors:
ld: Undefined symbols:
ARA::PlugIn::EditorView::setEditorOpen(bool), referenced from:
juce::AudioProcessorEditorARAExtension::AudioProcessorEditorARAExtension(juce::AudioProcessor*) in libmy_plugin_SharedCode.a[14](juce_audio_processors.mm.o)
juce::AudioProcessorEditorARAExtension::~AudioProcessorEditorARAExtension() in libmy_plugin_SharedCode.a[14](juce_audio_processors.mm.o)
ARA::PlugIn::PlugInExtension::~PlugInExtension(), referenced from:
juce::AudioProcessorARAExtension::~AudioProcessorARAExtension() in libmy_plugin_SharedCode.a[9](PluginWrapper.cpp.o)
ARA::PlugIn::PlugInExtensionInstance::PlugInExtensionInstance(ARA::PlugIn::PlaybackRendererInterface*, ARA::PlugIn::EditorRendererInterface*, ARA::PlugIn::EditorViewInterface*), referenced from:
ARA::PlugIn::PlugInExtension::PlugInExtension() in libmy_plugin_SharedCode.a[9](PluginWrapper.cpp.o)
typeinfo for ARA::PlugIn::PlugInExtension, referenced from:
typeinfo for juce::AudioProcessorARAExtension in libmy_plugin_SharedCode.a[14](juce_audio_processors.mm.o)
typeinfo for ARA::PlugIn::PlaybackRenderer, referenced from:
typeinfo for juce::ARAPlaybackRenderer in libmy_plugin_SharedCode.a[14](juce_audio_processors.mm.o)
typeinfo for ARA::PlugIn::DocumentController, referenced from:
MyPluginAudioProcessor::didBindToARA() in libmy_plugin_SharedCode.a[9](PluginWrapper.cpp.o)
vtable for ARA::PlugIn::PlugInExtension, referenced from:
ARA::PlugIn::PlugInExtension::PlugInExtension() in libmy_plugin_SharedCode.a[9](PluginWrapper.cpp.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Note that PluginWrapper.cpp
referenced here is a source file added to the plugin target which implements the juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
function. Removing the call to that function from the standalone code leads to an error free build.
I’m having a hard time understanding what’s going wrong here, given that the auto generated plugin type targets (e.g. myPlugin_VST3) also “just” link against the myPlugin
, so technically link against libmy_plugin_SharedCode.a
and create a working dynamic library or in case of the Standalone plugin type even an executable. I see that the juce code uses a plain add_executable
rather than juce_add_gui_app
so I tried that as well, just to get a lot more undefined symbol errors in that case (ARA related ones and symbols from other dependencies the plugin links against). I also see that the juce code does quite a bit more and I’m not sure if I’m missing an important step, I tried adapting that include directories propagation that is done here but I don’t see that making any difference.
Can anyone explain to me what is going wrong here and make suggestions about how to do all that properly? By the way, my goal is not a simple standalone version of a plugin but integrating the plugin into a standalone tool with a much more sophisticated feature set, so I don’t think just using the standalone version will be the solution.