I’m trying to follow this tutorial in Xcode
https://docs.juce.com/master/tutorial_main_window.html
when I get to the point of adding the initialise function line I get this error.
I think there is an error in the tutorial and it should read:
void initialise (const String& commandLine) override
{
mainWindow.reset(new MainWindow (getApplicationName()));
}
I hope this helps!
2 Likes
Awesome, thank you!
@BBloxham1 the old approach is from when JUCE used ScopedPointer
to hold heap-allocated types. The recommended approach is to use std::unique_ptr
now for individual objects. If you scroll down in your Main.cpp
, you’ll see a std::unique_ptr<MainWindow> mainWindow;
member at the bottom.
You can learn how to use unique_ptr
correctly here: https://en.cppreference.com/w/cpp/memory/unique_ptr
1 Like
We’ll get those tutorials updated, thanks.