Building the demo errors

Hi,

I am trying to learn Juce, and am following the tutorials as best I can.

This page specifically: JUCE: Tutorial: Create a basic Audio/MIDI plugin, Part 2: Coding your plug-in

I am getting these two errors:

On PluginEditor.cpp I get the error:

"Use of undeclared identifier ‘g’ " 4 times:

void TutorialPluginAudioProcessorEditor::resized()
{
// This is generally where you’ll want to lay out the positions of any
// subcomponents in your editor…

// fill the whole window white
g.fillAll (juce::Colours::white); Use of undeclared identifier 'g'

//set the current drawing color to black
g.setColour (juce::Colours::black); Use of undeclared identifier 'g'

// set the font size and draw text to the screen
g.setFont (15.0f); Use of undeclared identifier 'g'
g.drawFittedText ("Midi Volume", 0, 0, getWidth(), 30, juce::Justification::centred, 1); Use of undeclared identifier 'g'

}

I also am getting one error in the PluginEditor.h header file:

" Expected member name or ‘:’ after declaration specifiers "

void sliderValueChanged (juce::Slider* slider) override; //[3]
{ Expected member name or ‘:’ after declaration specifiers
audioProcessor.noteOnVel = midiVolume.getValue();
}

Looks like you’re trying to draw your component in the resized() method, you probably want this in your paint() method though.

You’ve got a semi-colon after override but then go on to define the function body, you need to remove that semi-colon.

1 Like

Thanks. I went through the tutorial again, and changed a bunch of stuff. I just is not clear enough where the different pieces of code goes.