In particular the last line (addParameter(gainParam)) is showing an error, saying that "argument of type "juce::AudioParameterFloat *" is incompatible with parameter of type "juce::AudioProcessorParameter *" "
Which is surprising, since after checking the documentation AudioParameterFloat is inheriting from AudioProcessorParameter (which is the type required by addParameter)...
At least now I am sure that my understanding of the addParameter() method is correct and that the problem lies somewhere else. I'll keep searching and will answer again below if the problem persists... I have noticed that sometimes the "link" between the libraries/classes definition "disappears" in Visual Studio. It happened to me that I create a new project, but the methods aren't recognized... so maybe my problem is linked to something like that.