Compiler errors in OSX but not in Windows

support for the ARM toolchain
Post Reply
ant512
Posts: 12
Joined: Sat Feb 06, 2010 11:10 am

Compiler errors in OSX but not in Windows

Post by ant512 » 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:

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
This is the code it is trying to build:

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);
The problem function (addKeyboardEventHandler) looks like this:

Code: Select all

inline void addKeyboardEventHandler(KeyboardEventHandler* eventHandler) { _keyboardEventHandlers.push_back(eventHandler); };
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.

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Compiler errors in OSX but not in Windows

Post by WinterMute » Sun Feb 07, 2010 5:32 am

It'd be helpful if you could reduce that to a minimum testcase and attach it to the bugtracker, these things tend to be awkward to work with in a large project.
Help keep devkitPro toolchains free, Donate today

Personal Blog

ant512
Posts: 12
Joined: Sat Feb 06, 2010 11:10 am

Re: Compiler errors in OSX but not in Windows

Post by ant512 » Sun Feb 07, 2010 3:18 pm

I spent an hour or so trying to whittle the code down to the bare minimum, and oops - it turns out not to be a devkitARM problem at all. The script I use to deploy the library uses an absolute source path to copy the files from, but I'm working on branch of the main codebase. The script was copying the wrong version of the library.

Whoops!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests