Button error [this declaration has no storage type]

I'm getting an error with my button after trying to create a basic program..

here's my code


#include "../JuceLibraryCode/JuceHeader.h"

    This component lives inside our window, and this is where you should put all
    your controls and content.
class MainContentComponent   : public Component
    void paint (Graphics&);
    void resized();
    button1 = new TextButton(("Button 1"));
    TextButton button1;
    Slider slider1;
    Label label1;


thanks in advance

There are multiple issues with your code: first of all, the new operator will return a pointer to TextButton, which you trying to assign to a TextButton object directly. Also, you are doing the assignment (and calling new) outside of any function. You need to pull this into the constructor for example. See some of the example code in the example subfolder of JUCE.