Cannot instantiate abstract class

hello.
why does this “class SimpleguisliderAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::Slider::Listener”

produce this error?

"Severity Code Description Project File Line Suppression State
Error C2259 ‘SimpleguisliderAudioProcessorEditor’: cannot instantiate abstract class simpleguislider_SharedCode C:\JUCE\projects\simpleGuiSlider\simpleguislider\Source\PluginProcessor.cpp 175
"
but removing the listener from the clss decleration header removes the error, despite all the examples having the listener in the header?

An abstract class is a class with methods that a subclass has to implement.
In case of the Slider::Listener this is

void sliderValueChanged (Slider*)

You recognise pure virtual functions by =0 in their declaration.

Have a look at the Slider-Listener docs and maybe a C++ tutorial about abstract classes.

Good luck

thanks for the reply but i know what an abstract class is. my question is why does this code produce the error when another example with exactly the same class header decleration does not? which bit is the abstract class? Slider is not as shown by other examples.

Does your derrived class implement void sliderValueChanged(Slider*)?
Did you use the override keyword so you would get a warning if you misspelled that method?

here’s the editor class
including the slider called volSlider

class SimpleguisliderAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::Slider::Listener
{
public:
SimpleguisliderAudioProcessorEditor (SimpleguisliderAudioProcessor&);
~SimpleguisliderAudioProcessorEditor() override;

//==============================================================================
void paint (juce::Graphics&) override;
void resized() override;

private:
// This reference is provided as a quick way for your editor to
// access the processor object that created it.
SimpleguisliderAudioProcessor& audioProcessor;
juce::Slider volSlider;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SimpleguisliderAudioProcessorEditor)

};

silly me. i put the header in and added the listener but forgot the member function. adding it fixed the problem. the error message was misleaded, however your response bought ti to my attention, thank you for your help,

Maybe I phrased it badly, but that’s exactly what I tried to tell you :wink:

Glad it’s sorted