Using Projucer, I created a GUI component PreferencesDialog (parent class DialogWindow) and set Constructor params as
const String &name, Colour backgroundColour, bool escapeKeyTriggersCloseButton, bool addToDesktop=true
My problem is that in PreferencesDialog.cpp Projucer creates
PreferencesDialog::PreferencesDialog (const String &name, Colour backgroundColour, bool escapeKeyTriggersCloseButton, bool addToDesktop=true)
which causes error C2572 “Redefinition of default parameter”. By removing =true manually in Visual Studio, I can temporarily solve the problem but once I reopen the project again by clicking Save and Open in IDE, =true is back again (in the cpp file).
Since there is only one Constructor params text area to enter the parameters, I assume that defaults should be automatically removed when the cpp file is created. Or, if not, Projucer does not allow default parameters. Which imho does not make sense.
What am I doing wrong?