Hello world!
I’m new to Juce and starting to give up on it already with these tutorials always giving me errors. I am doing EXACTLY step by step what the tutorials have told me and when i compile it on XCode the build fails. I’m going to start with this example from tutorial:
https://docs.juce.com/master/tutorial_main_window.html
Here is the code that i have:
#include "../JuceLibraryCode/JuceHeader.h"
//==============================================================================
class MainWindowTutorialApplication : public JUCEApplication
{
public:
//==============================================================================
class MainWindow : public DocumentWindow
{
public:
MainWindow (String name) : DocumentWindow (name,
Colours::lightgrey,
DocumentWindow::allButtons)
{
centreWithSize (300, 200);
setVisible (true);
}
void closeButtonPressed() override
{
JUCEApplication::getInstance()->systemRequestedQuit();
}
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
};
private:
ScopedPointer mainWindow;
};
MainWindowTutorialApplication() {}
const String getApplicationName() override { return ProjectInfo::projectName; }
const String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; }
//==============================================================================
void initialise (const String& commandLine) override
{
// Add your application's initialisation code here..
mainWindow = new MainWindow (getApplicationName());
}
void shutdown() override
{
// Add your application's shutdown code here..
mainWindow = nullptr;
}
//==============================================================================
void systemRequestedQuit() override
{
// This is called when the app is being asked to quit: you can ignore this
// request and let the app carry on running, or call quit() to allow the app to close.
quit();
}
void anotherInstanceStarted (const String& commandLine) override
{
// When another instance of the app is launched while this one is running,
// this method is invoked, and the commandLine parameter tells you what
// the other instance's command-line arguments were.
}
};
//==============================================================================
// This macro generates the main() routine that launches the app.
START_JUCE_APPLICATION (MainWindowTutorialApplication)
The error I have is:
MainWindowTutorialApplication() {} — Expected unqualified i-d
const String getApplicationName() override { return ProjectInfo::projectName; } — Expected function body after function declarator
START_JUCE_APPLICATION (MainWindowTutorialApplication) – Allocating an object of abstract class type 'MainWindowTutorialApplication’_
I’ve tried moving these codes around to make sure it wasn’t a matter of things being in the wrong order, didn’t work and generate even more errors. This is the 3rd tutorial I try to do and all I get is errors. Some other tutorials that I did on other websites worked, so it’s not just me. I think the tutorials are missing steps and when you name as it “Beginner Level” you can’t just infer that the beginner will just fill in those gaps.
