A few things:
First of all, if you face a failing build, the exact error message your compiler gives you helps a lot to find out what went wrong even if they may look somewhat confusing for a newcomer, so it’s always a good idea to post your error message with such posts to help people helping you.
Second thing:
There are no official JUCE youtube tutorials so it’s not really clear what you mean by tutorial 14, 15 and 16, and you probably found some outdated non-official tutorial. This becomes especially evident as using the createAndAddParameter
API is not the recommended state of the art approach with creating parameters anymore. That being said it still can be used, so although you might be learning an outdated approach here, this should not be the source of any build error.
Regarding this line of code you posted:
treeState.createAndAddParameter (std::make_unique (GAIN_ID, GAIN_NAME, GAIN_NAME, gainRange,0.5f, nullptr, nullptr));
You need to tell std::make_unique
which type of object it should create. As std::make_unique
is a function template, you do this by specifying the type of object to create as template parameter. As we want to create a std::unique_ptr
holding an AudioProcessorValueTreeState::Parameter
instance, you need to call
treeState.createAndAddParameter (std::make_unique<AudioProcessorValueTreeState::Parameter> (GAIN_ID, GAIN_NAME, GAIN_NAME, gainRange,0.5f, nullptr, nullptr));
In case the line you posted above was no copy & paste failure, this might probably be the reason for your error.