Hello all,
I’m completely stumped. The following minimal code compiles on GNU:
#include "juce.h"
struct MyMainComponent : public TextEditor
{
MyMainComponent(){}
~MyMainComponent(){deleteAllChildren();}
};
struct MyMainWindow : public DocumentWindow, public MenuBarModel,
public ApplicationCommandTarget
{
MyMainWindow(ApplicationCommandManager* cmdmanager) :
juce::DocumentWindow (juce::String("MyMainWindow"),
juce::Colours::lightgrey,
juce::DocumentWindow::allButtons, true)
{
cmdmanager->registerAllCommandsForTarget (this);
addKeyListener(cmdmanager->getKeyMappings());
setContentComponent(new MyMainComponent());
setMenuBar(this);
setVisible(true);
centreWithSize(400, 400);
}
~MyMainWindow(){}
void resized(){}
void closeButtonPressed(){}
const StringArray getMenuBarNames()
{StringArray t;return t;}
const PopupMenu getMenuForIndex(int index, const String& name)
{PopupMenu m; return m;}
void menuItemSelected(int menuItemID, int topLevelMenuIndex){}
ApplicationCommandTarget* getNextCommandTarget(){return 0;}
void getAllCommands(Array <CommandID>& commands){}
void getCommandInfo(const CommandID commandID, ApplicationCommandInfo& result){}
bool perform(const InvocationInfo& info){return true;}
};
struct MyApplication : public juce::JUCEApplication
{
MyMainWindow* _mainwindow;
ApplicationCommandManager* _commandmanager;
MyApplication() : _mainwindow (0), _commandmanager (0) {}
~MyApplication(){}
void initialise(const juce::String& commandLine)
{
_commandmanager = new ApplicationCommandManager();
_mainwindow = new MyMainWindow(_commandmanager);
}
void shutdown()
{
delete _mainwindow;
delete _commandmanager;
}
const juce::String getApplicationName(){return juce::String("Test");}
};
START_JUCE_APPLICATION(MyApplication)
But on Visual Studio 2005, I get the error messages:
d:\projects\mtw\gui\mtw\mtwapplication.cpp(41) : error C2385: ambiguous access of 'delete'
1> could be the 'delete' in base 'juce::DocumentWindow'
1> or could be the 'delete' in base 'juce::MenuBarModel'
1> or could be the 'delete' in base 'juce::ApplicationCommandTarget'
1> This diagnostic occurred in the compiler generated function 'void *MyMainWindow::__delDtor(unsigned int)'
1>d:\projects\mtw\gui\mtw\mtwapplication.cpp(54) : error C2385: ambiguous access of 'new'
1> could be the 'new' in base 'juce::DocumentWindow'
1> or could be the 'new' in base 'juce::MenuBarModel'
1> or could be the 'new' in base 'juce::ApplicationCommandTarget'
1>d:\projects\mtw\gui\mtw\mtwapplication.cpp(54) : error C2385: ambiguous access of 'delete'
1> could be the 'delete' in base 'juce::DocumentWindow'
1> or could be the 'delete' in base 'juce::MenuBarModel'
1> or could be the 'delete' in base 'juce::ApplicationCommandTarget'
1>d:\projects\mtw\gui\mtw\mtwapplication.cpp(59) : error C2385: ambiguous access of 'delete'
1> could be the 'delete' in base 'juce::DocumentWindow'
1> or could be the 'delete' in base 'juce::MenuBarModel'
1> or could be the 'delete' in base 'juce::ApplicationCommandTarget'
There’s nothing out there on this kind of error, but I’m guessing it’s something to do with how I’m inheriting things. Can someone point me in the right direction?
Thank you!