What is the full text of the linker error? It should tell you in which translation unit the other symbol is defined. If the duplicate symbol is in juce_audio_plugin_client_Standalone.cpp, that would suggest that the JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP definition isn’t active in that file, and you should check that you re-exported the Projucer project after adding that definition. If the duplicate symbol is in one of your files, then that might mean that you have several entry points in your code, or are mistakenly compiling a file twice (perhaps including a .cpp in another .cpp, but also building both .cpp files individually).
duplicate symbol 'juce_CreateApplication()' in:
/.../Builds/MacOSX/build/Debug/libL12X Solid State Amplifier.a(LC_StandaloneFilterApp.o)
/.../Builds/MacOSX/build/Debug/libL12X Solid State Amplifier.a(PluginEditor.o)
ld: 1 duplicate symbol for architecture x86_64
In PluginEditor, I just have the include for LC_StandaloneFilterApp.cpp" along with inclusions for PluginProcessor.h and PluginEditor.h
The error is saying that the duplicate function is defined both in LC_StandaloneFilterApp.cpp and PluginEditor.cpp.
You should either include LC_StandaloneFilterApp.cpp in PluginEditor.cpp, or add it as a separate translation unit in the Projucer. Don’t do both. Each .cpp should only be built/included once in the final project.
No, the macro just defines the juce_CreateApplication function.
When you build the program, you’ll end up with one copy of this function in LC_StandaloneFilterApp.cpp (because that’s where the macro is expanded), and a second copy in PluginEditor.cpp (because that file includes LC_StandaloneFilterApp.cpp, which contains the macro).
It’s an error to define the same (non-inline) function in multiple translation units. To ensure that the function is only defined once, you need to ensure that the macro is only used in a single translation unit. In this case, that’s achieved by either removing the include from PluginEditor.cpp (the only macro expansion will be in the StandaloneFilterApp TU), or avoiding adding the StandaloneFilterApp as a TU altogether (the macro expansion will happen in the PluginEditor.cpp, as this file includes StandaloneFilterApp.cpp).
Outside of a JUCE module, it’s a bad idea to include .cpp files inside other .cpp files as it’s very easy to end up with these duplicate symbol errors, so I’d recommend that removing the LC_StandaloneFilterApp.cpp include is the better solution.
Hey, question related to allowing different input configs.
I am trying to give the Standalone Plugin app the ability to select more than 2 channels from the input device.
The purpose is to allow 4/6/8/etc channels of processing in the standalone version of the plugin.
This can be done with AudioPluginHost.
I’m trying to avoid having to deep dive into the APH code and figure out where this happens and am hoping it is a relatively simple fix for the Standalone Plugin target.
Is this still the only way to do that? It’s very strange that you need to rewrite all the Standalone app code just to change one very simple option, but of course I would like to avoid to change JUCE library code!