Когда я пытаюсь скомпилировать демонстрационный файл из В этом руководстве , я получаю ошибку no operator "=" matches these operands
. Я попытался включить строку (совет из похожих вопросов), но это, кажется, не имеет смысла, так как она уже должна быть включена в JuceHeader.h
.
Проблема с кодом:
void initialise (const String& commandLine) override
{
// Add your application's initialisation code here..
mainWindow = new MainWindow (getApplicationName());
}
Полный код:
#include "../JuceLibraryCode/JuceHeader.h"
#include <string>
//==============================================================================
class MainWindowTutorialApplication : public JUCEApplication
{
public:
//==============================================================================
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.
}
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:
std::unique_ptr<MainWindow> mainWindow;
};
//==============================================================================
// This macro generates the main() routine that launches the app.
START_JUCE_APPLICATION (MainWindowTutorialApplication)