Welcome! Log In Create A New Profile

Advanced

Can't get SDL for Wii to fly... :-(

Posted by petrander 
Can't get SDL for Wii to fly... :-(
July 21, 2009 11:45PM
Hi all,

I recently discovered Wii Homebrew, set up the Homebrew channel with some sample apps, and I am excited to get started developing my own stuff. I am new to C++, but thanks to the WiiWizard for Visual Studio I had a good start and already got the "Hello World!" to show up on my Wii.

Next I wanted to try some graphics and was interested in using SDL. So I downloaded SDL for Wii, and put all the proper files in the right folders according to instructions. I changed the following line in the makefile:

LIBS	:=	-lSDL_net -lSDL_ttf -lSDL_gfx -lSDL_mixer -lSDL_image -lSDL \
            -lsmpeg -ljpeg -lpng -lfreetype -ltremor \
            -lz -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard \
, but whenever I build now, I keep on getting errors. It is as if the required libraries are missing from my DevkitPro / libOCG installation.

First I get a "c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-gekko/bin/ld.exe: cannot find... " for all the libs referenced to in the second line (-lsmpeg -ljpeg -lpng -lfreetype -ltremor). Since I for my first project do not need to work with media files, fonts or whatever, I left out the second line completely. But then it trips over the 'lwiikeyboard' that it cannot find. Deleting also that one, gives me a range of different error messages:

C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:68: undefined reference to `MOUSE_Init'
C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:69: undefined reference to `KEYBOARD_Init'
c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wiievents.o): In function `PumpEvents':
C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiievents.c:64: undefined reference to `KEYBOARD_GetEvent'
C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiievents.c:65: undefined reference to `MOUSE_GetEvent'

I am really stuck and don't know what to do next. Do I need to reinstall DevKitPro? Perhaps by using SVN to check out??
Re: Can't get SDL for Wii to fly... :-(
July 21, 2009 11:54PM
Use an older version of SDL Wii, like SDL Wii 04-23-2009.zip on [code.google.com] OR update libogc.
Re: Can't get SDL for Wii to fly... :-(
July 22, 2009 12:12AM
Thanks for replying! I downloaded and installed the older version of SDL Wii, started a new project from scratch, changed the libs mentioned in the makefile, used the first example from GabberNL's tutorial, but alas:

c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-gekko/bin/ld.exe: cannot find -lsmpeg

Me no understande... :-(
Re: Can't get SDL for Wii to fly... :-(
July 22, 2009 02:03AM
You should be using the latest libogc from SVN, download the package of required libs (smpeg, etc), and use the latest Wii SDL from svn.

If you're new to this you should be following these instructions, clearly posted on the front page of the SDL Wii site:

[code.google.com]

Good luck!
Re: Can't get SDL for Wii to fly... :-(
July 22, 2009 10:04PM
Hi Tantric,

Thanks for the help. I was following the instructions on the wiki page, whereas I should have paid more attention to the project's home page itself. Thanks for pointing my nose in the right direction. I did what you recommended and I got a lot further, but am not quite there yet.

Now the second LIB line in the make file is no longer causing any problems. The only thing left is 'lwiikeyboard'.

../powerpc-gekko/bin/ld.exe: cannot find -lwiikeyboard

What does 'lwiikeyboard' do and does leaving it out has anything to do with the following error messages that then come up:

C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:68: undefined reference to `MOUSE_Init'
C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:69: undefined reference to `KEYBOARD_Init'
c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wiievents.o): In function `PumpEvents':
C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiievents.c:64: undefined reference to `KEYBOARD_GetEvent'
C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiievents.c:65: undefined reference to `MOUSE_GetEvent'

On the wiki-talk page I read something about a change in libocg causing exactly these error messages. Should I try to downgrade libocg to an earlier version?
Re: Can't get SDL for Wii to fly... :-(
July 22, 2009 10:15PM
libwiikeyboard.a is in the libogc SVN. You'll have to download and make it yourself for now. - [sourceforge.net]
Re: Can't get SDL for Wii to fly... :-(
July 22, 2009 11:34PM
Quote
scanff
libwiikeyboard.a is in the libogc SVN. You'll have to download and make it yourself for now. - [sourceforge.net]

What do you mean exactly? Do I have to take the libwiikeyboard.a-file and move it over to the proper location in the DevKitPro folder? Will this solve all problems?

Thnx in advance...
Re: Can't get SDL for Wii to fly... :-(
July 23, 2009 12:18AM
libwiikeyboard.a needs to be under the libogc/lib/wii directory. I think you'll have to build libogc from the source to get libwiikeyboard.a, it's not part of the current devkitpro release.
Re: Can't get SDL for Wii to fly... :-(
July 23, 2009 06:37AM
that's right, it's really easy. find an svn client, download devkitpro svn. then type make and make install in the libogc folder. done.
Re: Can't get SDL for Wii to fly... :-(
July 23, 2009 05:10PM
It worked!

Although I have about a decade of programming experience, I have never really worked with C/C++ and compiled any C-code before, so this is all new to me. I followed the suggestions and now it finally compiles! I am also starting to understand what is going on here: C-source is compiled to object-code which is then installed in the library as archive files... Yes, yes!

Thanks everyone for their patience! I better get some good resources on C++... I in any case already have Stroustrups book! :-)
Re: Can't get SDL for Wii to fly... :-(
August 04, 2009 05:44PM
Now that you have the late version of libogc and libSDL, you can play your SDL games with a keyboard (due to libwiikeyboard and/or SDL modifications). Nice for testing before remap inputs with wpad libs.
having error compiling
October 12, 2009 12:53AM
problem with this line too

-lsmpeg -ljpeg -lpng -lfreetype -ltremor \

eroor:
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.1/../../../../powerpc-eabi/bin/ld.exe: cannot find -ljpeg

i dont know wy
i have devkitPPC r18 and libogc 1.8.0 already installed

help
EDIT:
fixed ... Tremor,freetype and png,, but cant find ljpeg....



Edited 1 time(s). Last edit at 10/12/2009 01:19AM by ahrimanes.
Re: Can't get SDL for Wii to fly... :-(
October 12, 2009 03:16AM
Sorry, only registered users may post in this forum.

Click here to login