How to fix this error? C3646 'checkTime': unknown override specifier

#pragma once

#include <JuceHeader.h>

//==============================================================================
/*
    This component lives inside our window, and this is where you should put all
    your controls and content.
*/
class MainComponent  : public juce::Component
{
public:
    //==============================================================================
    MainComponent();
    ~MainComponent() override;

    //==============================================================================
    void paint (juce::Graphics&) override;
    void resized() override;

private:
    //==============================================================================
    // Your private member variables go here...
    Button checkTime;

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainComponent)
};

Two things are wrong here:

  1. If I get it right you have created a fresh JUCE 6 project with default settings, where for good readons using namespace juce is no longer set by default in the auto generated headers. This means the compiler does not know what you mean with Button, you have to specify juce::Button instead.
  2. But even juce::Button is wrong, because it‘s an abstract class only defining common behaviour for all kinds of buttons. You have to use one of the derived button classes like juce::TextButton or juce::DrawableButton
1 Like

thanks