deviceManager error


I haven’t done any programming for years but I used JUCE a while ago to make an audio plugin and it was great. I’m probably being stupid but can someone tell me why the compiler keeps telling me “deviceManager” is undeclared? Here’s the code for the files:


#include “…/JuceLibraryCode/JuceHeader.h”
#include “MainComponent.h”

class MainWindow : public DocumentWindow
MainWindow() : DocumentWindow (“Synth”,
setContentOwned (new MainComponent (deviceManager), true); [color=#FF0000]error: use of undeclared identifier ‘deviceManager’[/color]

    centreWithSize (getWidth(), getHeight());

    setVisible (true);


//There’s a bunch of application stuff here too but I don’t think that’s relevant.



#include "…/JuceLibraryCode/JuceHeader.h"
class SynthAudioSource;

class MainComponent : public Component,
public ButtonListener
MainComponent (AudioDeviceManager& deviceManager_);

void paint (Graphics& g);
void resized();
void buttonClicked (Button* buttonThatWasClicked);

Label* mainLabel;
TextButton* quitButton;
Path internalPath1;
AudioDeviceManager& deviceManager;
MidiKeyboardState keyboardState;
AudioSourcePlayer audioSourcePlayer;
ScopedPointer synthAudioSource;

MidiKeyboardComponent* keyboardComponent;



Have I done a circular include here or something? Or should I be dealing with deviceManager differently?

Any help would be much appreciated. Cheers.


the error message is pretty clear "error: use of undeclared identifier ‘deviceManager’, so where is deviceManager defined?
If you don’t what i mean, it maybe would be helpful to begin with an c++ tutorial

PS: please use the code-tag for source code in the forum