C2146 syntax error?


#1

Hi all

In the MainContentComponent class/Private:, I am trying to add a member variable of type class. 

This class is defined in a separate pair of .cpp and .h files.

At compile time on VS2010 XP-windows platform, I get the "error C2146: syntax error : missing ';' before identifier 'Op1'". 


class MainContentComponent   : public Component
{
public:
    //==============================================================================
    MainContentComponent();
    ~MainContentComponent();
    void paint (Graphics&);
    void resized();
private:
    OperationPanel Op1;
    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent)
};
 

The contents of OperationPanel.h :


class OperationPanel  : public Component,
                                    public ButtonListener
{
public:
    //==============================================================================
    OperationPanel ();
    ~OperationPanel();
    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
    //[/UserMethods]
    void paint (Graphics& g);
    void resized();
    void buttonClicked (Button* buttonThatWasClicked);


private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    //[/UserVariables]
    //==============================================================================
    ScopedPointer<ToggleButton> btn_OnOff;
    ScopedPointer<ToggleButton> btn_InOut;
    ScopedPointer<GroupComponent> OperationPanelGroup;

    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OperationPanel)
};
 

Any idea about this ?

Thanks in advance

 

George

 

 


#2

Did you by any chance forget to include OperationPanel.h in your MainContentComponent header?


#3

Of course I forgot it.

xm.... it tends to be a standard procedure

I feel stupid now.

Thanks


#4

You are welcome :)