Welcome! Log In Create A New Profile

Advanced

Porting Problems

Posted by unhuman 
Porting Problems
February 02, 2010 05:09AM
I'm beginning a port of an open source app to bring to the Wii. It's been a while since I've done hard-core C/C++ programming, but I'm hopeful that I'm up to the task. A few things I noticed:

1. I get warnings that memory.h doesn't exist. No biggie, I hope, it's just a warning.
2. I'm getting "error: 'qsort' was not declared in this scope." The file is indeed including , so I do not understand why this would be. I could hack my own qsort into the project, but that doesn't seem ideal.

Any help would be appreciated. I've got 7 files compiling before this error :) And, I'm using a stolen / hacked up Make file for now... I'd like to get my project built and then integrate the Wii make into the original author's cross-platform system.

-Howie
Re: Porting Problems
February 02, 2010 08:03AM
1. memory.h just includes string.h, so include that instead.
2. add include stdlib.h

Good luck!
Re: Porting Problems
February 02, 2010 02:30PM
Code does have stdlib included... That's my problem. I know qsort should be defined... yet it's not.

#include <ctype.h>
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Guy included memory.h and string.h, so reasonably sure I'm good there.

Thanks so much!

-H



Edited 1 time(s). Last edit at 02/02/2010 02:32PM by unhuman.
Re: Porting Problems
February 02, 2010 07:05PM
Can you paste the exact errors that you're seeing. That would help a lot.
Re: Porting Problems
February 03, 2010 01:41AM
I had my INCLUDES pointing to:
$(DEVKITPPC)/powerpc-eabi/include/machine
instead of:
$(DEVKITPPC)/powerpc-eabi/include

That fixed it, but now it can't find endian.h, which again is a warning, but I suspect it'll be needed later?

And, it gets interesting again, of course... it's looking now for "swab" - which is in
$(DEVKITPPC)/powerpc-eabi/include/sys

But, if I include that, it breaks my build elsewhere...

But, if I hack out that single line - which I'd probably need - the entire thing compiles! Doesn't link - looking for png library.

Oh, the joys of porting, but it's really cranking along now.

BTW - I included my source - but removed it when i switched includes - to avoid revealing my project :)

-H



Edited 4 time(s). Last edit at 02/03/2010 03:54AM by unhuman.
Re: Porting Problems
February 03, 2010 04:17AM
More stuff... I've got it linking and only 2 undefined symbols - getuid and getpid - these not available for wii? or... What lib?

swab is available for the wii - no problem - it was wrapped by the original author:
#ifdef __LINUX__
#include <unistd.h>
#endif

So just down to link errors and then fix for Wii!



Edited 2 time(s). Last edit at 02/03/2010 04:23AM by unhuman.
Re: Porting Problems
February 03, 2010 04:28AM
And... it links! I am assuming that getuid and getpid for linux - and modified code to skirt that. Should work for testing.

-H
Re: Porting Problems
February 03, 2010 04:31AM
Not sure what you would expect getuid and getpid to return on the wii.
Re: Porting Problems
February 03, 2010 04:34AM
Yeah - worked around them... On to testing... I'll attempt that soon (wife has our TV cornered right now).
Sorry, only registered users may post in this forum.

Click here to login