Compiler errors in OSX but not in Windows
Posted: Sat Feb 06, 2010 1:43 pm
I've come across an interesting problem whilst developing Woopsi. I develop in Windows and OSX pretty much interchangeably, but have come across what appears to be a bug in the OSX compiler. It might be related to this problem, in which the OSX and WIndows compilers are producing different code:
http://forums.devkitpro.org/viewtopic.php?f=2&t=1694
This is the compiler output:
This is the code it is trying to build:
The problem function (addKeyboardEventHandler) looks like this:
The MultiLineTextBox class inherits from the KeyboardEventHandler class, so it is definitely the correct type.
This is the behaviour under OSX, which seems inexplicable. When compiling with Windows, the code compiles correctly and a working ROM is produced. I'm at a loss as to how to fix this.
I'm using devkitARM r27 in both operating systems. I installed devkitARM from scratch on another Mac in case my dev environment had broken some how, but had exactly the same problem.
http://forums.devkitpro.org/viewtopic.php?f=2&t=1694
This is the compiler output:
Code: Select all
Compiling keytest.cpp
/Repositories/woopsi/woopsi/branches/woopsi_with_freetype/Woopsi/examples/keyboard/source/keytest.cpp: In member function 'virtual void KeyTest::startup()':
/Repositories/woopsi/woopsi/branches/woopsi_with_freetype/Woopsi/examples/keyboard/source/keytest.cpp:38: error: no matching function for call to 'WoopsiUI::WoopsiKeyboard::addKeyboardEventHandler(WoopsiUI::MultiLineTextBox*&)'
/opt/devkitpro/libwoopsi/include/woopsikeyboard.h:91: note: candidates are: void WoopsiUI::WoopsiKeyboard::addKeyboardEventHandler(WoopsiUI::KeyboardEventHandler*)
make[1]: *** [keytest.o] Error 1
make: *** [build] Error 2
Code: Select all
(snip)
MultiLineTextBox* _output = new MultiLineTextBox(rect.x, rect.y, rect.width, rect.height, "", 0, 0);
_output->showCursor();
window->addGadget(_output);
(snip)
// Create keyboard
_keyboard = new WoopsiKeyboard(0, 13, 256, 179, "Keyboard", Gadget::GADGET_DRAGGABLE, 0);
_keyboard->addKeyboardEventHandler(_output);
inScreen->addGadget(_keyboard);
Code: Select all
inline void addKeyboardEventHandler(KeyboardEventHandler* eventHandler) { _keyboardEventHandlers.push_back(eventHandler); };
This is the behaviour under OSX, which seems inexplicable. When compiling with Windows, the code compiles correctly and a working ROM is produced. I'm at a loss as to how to fix this.
I'm using devkitARM r27 in both operating systems. I installed devkitARM from scratch on another Mac in case my dev environment had broken some how, but had exactly the same problem.