Cannot initialize a parameter of type 'juce::AudioProcessorValueTreeState::Listener *' with an rvalue of type

**This approach worked fine for my previous project, but now, I’m getting an error: 'Cannot initialize a parameter of type 'juce::AudioProcessorValueTreeState::Listener ’ with an rvalue of type 'DemoAudioProcessor ‘.’

//PluginProcessor.h
AudioProcessorValueTreeState parameters;


//PluginProcessor.cpp
DemoAudioProcessor::DemoAudioProcessor()
     : AudioProcessor(BusesProperties()
                      .withInput("Input", juce::AudioChannelSet::stereo(), true)
                      .withOutput("Output", juce::AudioChannelSet::stereo(), true)),
      parameters(*this, nullptr, “Demo”, juce::AudioProcessorValueTreeState::ParameterLayout{
        std::make_unique<juce::AudioParameterFloat>("gain", "Gain", -60.f, 12.f, 0.f),
    })
{
    parameters.addParameterListener("gain", this); // error: 'Cannot initialize a parameter of type 'juce::AudioProcessorValueTreeState::Listener *' with an rvalue of type 'DemoAudioProcessor *'.' 
}

What am I missing? I would appreciate it if anybody could point me in the right direction.

You have not shown the declaration of DemoAudioProcessor. Is it properly derived from AudioProcessorValueTreeState::Listener?

1 Like

Thank you, @cpr2323. Strange but it started working again after I updated xcode. Thanks again!

Glad you are moving forward again! :slight_smile:

1 Like