Call to deleted constructor of 'WavetablePlugInAudioProcessor'

Hi, i am working on a Wavetable Synthesizer, only worked in a sub class, but im getting the compile error “Call to deleted constructor of ‘WavetablePlugInAudioProcessor’” and “Unknown type name ‘WavetablePlugInAudioProcessorEditor’; did you mean ‘WavetablePlugInAudioProcessor’?” in the processor line:

```juce::AudioProcessorEditor* WavetablePlugInAudioProcessor::createEditor(){
return new WavetablePlugInAudioProcessorEditor (*this);
} ```

That confuses me, i didn’t changed anything of this function. What is to do to fix this?

Thanks

1 Like

The deleted constructor error is usually associated with the smart pointers. Are you moving your Editor so it is not a sub class of the Processor?

It would be good to see the exact error message, including where the error occurred.
While it is a common mistake to accidently copy things that have the copy constructor intentionally deleted, there are other mistakes that show similar errors.

1 Like

thanks for your reply.
like so?



What does it mean to ‘copy things that have the copy constructor intentionally deleted’? Sorry i’m quite new to Juce and C++ and learn both simultaneously.

thanks for the reply.
I dont think so, but i dont really know, how would i move the Editor?

The copy constructor is a red herring. It doesn’t know your Editor by the type of WavetablePlugInAudioProcessorEditor. It seems you simply forgot/removed the include to the class declaration, usually called like this in the PluginProcessor.cpp:

#include "PluginEditor.h"

or similar, check the actual name in your project.

1 Like

Yes thanks, i dont have a clue how i deleted that accidentally^^

Now i am getting:

“No matching constructor for initialization of ‘WavetablePlugInAudioProcessorEditor’”

in the same line,

“1. Candidate constructor not viable: no known conversion from ‘WavetablePlugInAudioProcessor’ to ‘const WavetablePlugInAudioProcessorEditor’ for 1st argument”

in the last line of the editor (JUCE_DECLARE_NON_COPYABLE…) and

“2. Candidate constructor not viable: requires 2 arguments, but 1 was provided”

in the constructor line of the editor.h file, wich is:
WavetablePlugInAudioProcessorEditor (WavetablePlugInAudioProcessor&, WavetableSound&);

It seems to me that i have to declare a pointer to my subclass WavetableSound in

juce::AudioProcessorEditor* WavetablePlugInAudioProcessor::createEditor()
{
    return new WavetablePlugInAudioProcessorEditor (*this);
}

because the editor changes variables in the subclass. Am i right and if so how do i do that?

Yes, you added a second parameter (argument) to your constructor, that you have to supply.
Assuming you have a member in your processor you have to supply it to the constructor:

// member:
WavetableSound sound;

juce::AudioProcessorEditor* WavetablePlugInAudioProcessor::createEditor()
{
    return new WavetablePlugInAudioProcessorEditor (*this, sound);
}
2 Likes

Ah thanks, works now:)

1 Like