Page 1 of 1

How to use the SDL port?

Posted: Mon Apr 14, 2008 7:51 am
by kouky
Hi,
I'd like to port a SDL software to PS2.
I've succesfully setup CodeBlocks for ps2dev and built a hello world not using SDL.

Then I wanted to enable SDL functions so I've downloaded the SDL folder from the ps2dev SVN and tried to build the examples provided (checkkeys.c...)

But couldn't make it :(

CodeBlocks complains about
"
ld:: cannot find -lsdl
:: === Build finished: 1 errors, 0 warnings ===
"

Is this SDL library ready to use?
I mean I just have to include <SDL.h> and it's supposed to work ??

Thanks for you help

Posted: Mon Apr 14, 2008 8:44 pm
by cosmito
Did you tried first the "traditional" way of making the example, that is, issuing a "make" on the command line / shell ?
Did it compiled with success?

Posted: Tue Apr 15, 2008 12:49 am
by kouky
Oops, I don't know how to do the traditionnal way!

Posted: Tue Apr 15, 2008 2:48 am
by kouky
Maybe I've haven't installed it properly...

Are those step by step instructions good to follow:
http://www.netadelica.com/coding/sdl/install.html
?

Posted: Tue Apr 15, 2008 9:58 am
by cosmito
kouky wrote:Are those step by step instructions good to follow:
http://www.netadelica.com/coding/sdl/install.html
?
Nope, these instructions do not apply to the PS2 (unpacking a dll doesn't make sense).
Yes, you need to do a "make" and a "make install".
The SDL installation for the PS2 sdk requires some steps, although not too much difficult... I may do a tutorial (not very soon I'm afraid...)

Posted: Tue Apr 15, 2008 10:05 am
by kouky
Thank you,

I've finally been able to make it work.

I've succesfully compiled a elf file displaying a few SDL rectangle. Very exciting :)

Now I'm trying to figure out why
FILE * f=fopen("someFile","r");
always returns NULL...

Anyway, I'm happy to finally be able to develop on PS2!

Posted: Tue Apr 15, 2008 1:06 pm
by ooPo
Try:

fopen("host:someFile","r");