SDL setup question

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

SDL setup question

Post by b00st »

Ive been looking for how to setup SDL/SDL_Image for the devkit and aren't sure what to do. I've found the SVN but not sure what I need or how to set it up. Any info would be great.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Read README.PSP
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

don't think Im reading this right. autogen.sh doesn't download anything. I have to download everything in the /trunk/SDL folder, don't I? Im not really sure how to use SVN. lil help?

(sorry if im being a pest, but if it helps me, it'll probably help a few other people)

###EDIT###
Realised the toolkit had to download PSPSDK via SVN. looked through toolchain.sh and found what I needed.
svn checkout svn://svn.ps2dev.org/psp/trunk/SDL

Thanks anyway
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

ok, now i ./autogen.sh and all is fine. Next, I try

LDFLAGS="-L'/usr/local/pspdev/bin/psp-config.exe --/usr/local/pspdev/psp/sdk' /lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix='/usr/local/pspdev/bin/psp-config.exe --psp-prefix'

but I get 'checking for C compiler default output file name... configure: error: C compiler cannot create executables'

I can upload the config.log if it'll help...
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

I don't know where you got that command, but it's wrong. Use the one in README.PSP:

Code: Select all

LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=`psp-config --psp-prefix`
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

jimparis: My command is the same, except I put the whole path to psp-config.

I fixed it up anyway and tried again with the same result. Im guessing this is a compiler problem. The line it is breaking on is:

checking for C compiler default output file name... configure: error: C compiler cannot create executables

its looking right at psp-gcc, and I know it works because I've built the samples in the PSPSDK with it...

looking at the config.log, i see a line:
configure:2623: psp-gcc conftest.c >&5
then there are a few 'undefined reference to' lines. Some of them are 'sceKernelCreateThread' and 'sceKernelStartThread'. It then goes on to show the actual conftest.c which is just something like:

int main () {
;
return 0;
}

Would it be because psp-gcc is looking for all that psp goodness we add to every program? BTW, is it just me or has anyone else had this problem?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

b00st wrote:jimparis: My command is the same, except I put the whole path to psp-config.
No, it is not. You put a space before "/lib" and you used apostrophes instead of backquotes. Read and follow README.PSP.
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

even when I copy and paste the command from README.PSP i get the same thing. I dont think this is from an incorrect ./configure.
Afterwards, if i 'echo $LDFLAGS' I get
-L/user/local/pspdev/psp/sdk/lib -lc -lpspuser -lpsputility
I think thats what it should be. :(
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

Still getting the same results... So, noone can help at the moment?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

No idea, it works here. Maybe try removing and reinstalling everything from a clean slate (http://wiki.ps2dev.org/psp:programming_faq)
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

Yeah, I removed cygwin and reinstalled it today hoping it would fix it. Followed the link you gave exactly. I was thinking, Its not an environment variable I haven't set or anything, do you think? The only ones Ive set are the three it said to add to by .bashrc:

## PSPDEV PATH SETTINGS
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"

Also, would it help if I did my './configure > output.txt' so you could take a look?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Sure, paste that (and config.log) on rafb.net/paste
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

ok, I pasted it to http://rafb.net/paste/results/blfdqK44.html
Pasted by: b00st
Language: Plain Text
Description: SDL Setup Problems
You have 24 hours from now to view it, but i can repaste if needed or send to you as a text file.
Thanks for being patient and not just ignoring my rants.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Well of course the best place to start is the first error:

Code: Select all

LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=`psp-config --psp-prefix`
configure: error: expected an absolute directory name for --prefix: psp-config --psp-prefix
This is the source of the problem. It looks like your shell isn't properly expanding the backquotes. Make sure you're running bash:

Code: Select all

$ /bin/bash
and try again. Or try it like this:

Code: Select all

LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=$(psp-config --psp-prefix)
or if that fails try

Code: Select all

LDFLAGS="-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=/usr/local/pspdev/psp
or as a last resort try

Code: Select all

export LDFLAGS="-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser -lpsputility"
./configure --host psp --prefix=/usr/local/pspdev/psp
although in that last case you'll have to remember to run

Code: Select all

unset LDFLAGS
afterwards or else other builds will fail.
b00st
Posts: 10
Joined: Mon Oct 17, 2005 5:09 pm

Post by b00st »

Ah my goodness! Tried it again with

Code: Select all

export LDFLAGS="-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser -lpsputility"
./configure --host psp --prefix=/usr/local/pspdev/psp
and seems to have worked. I had tried the same thing without 'export' with no luck. Thanks heaps, couldn't have done it without you!
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Being a complete n00b, where does SDL go in the first place? I'm trying to compile Rob's PSP PDA and it needs SDL. I know how to get it out of SVN but that's about it, and not even sure where to put it.

Then I guess I have to execute the stuff in the readme.psp in the Cygwin command prompt, or is that to include it into your project? (Rob's project has that already of course).

So what's the minimum I should do to be able to compile a project that already uses SDL in its makefile? If anyone can help me that would save me heaps of time of mucking about ... thanks!
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Just follow README.PSP and it will get installed into /usr/local/pspdev/psp/lib. Make sure you're running bash to avoid the problems above.
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

how to install SDL with devkitpro ?

I found automake and autoconf for mingw but still don't work
./autogen.sh: /bin/aclocal: No such file or directory
./autogen.sh: /bin/automake: No such file or directory
/bin/autoconf: /usr/bin/autom4te: No such file or directory
/bin/autoconf: /usr/bin/autom4te: No such file or directory
./autogen.sh: /bin/aclocal: No such file or directory
./autogen.sh: /bin/automake: No such file or directory
/bin/autoconf: /usr/bin/autom4te: No such file or directory
/bin/autoconf: /usr/bin/autom4te: No such file or directory
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

I installed active perl and copied all the files from c:\perl\bin\ in mingw bin, and it work but seems to freeze after writting "This may take a while ..."
I'm waiting since 10min ...
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

ok I installed mingw DTK and it work
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

I think the problem above (using devkitpro) is because:
psp-config --psp-prefix
give:
/c/devkitPro/devkitpsp/psp

and it should be:
/c/devkitPro/devkitPSP/psp

I tried with case sensitive path and it work pretty well :)
droneuath
Posts: 2
Joined: Thu Nov 03, 2005 8:05 am

SDL Compilation Issue

Post by droneuath »

Hi all!

Didn't want to create a new thread for this.

I tried to compile SDL from subversion and after running the command

Code: Select all

LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --prefix=`psp-config --psp-prefix`
(described in README.PSP) the following errormessage is displayed:

Code: Select all

./configure: line 21519: syntax error near unexpected token `src/thread,'
./configure: line 21519: `    COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)'
Does this sound familiar to anyone, perhaps an autoconf/automake issue?

Thanks in advance

PS.: All sources are fresh outa svn, Environment is Linux.
droneuath
Posts: 2
Joined: Thu Nov 03, 2005 8:05 am

Post by droneuath »

Issue is resolved, repository was broken. I did a final svn checkout to be sure its the latest version and got it working ;)
User avatar
Thanhda
Posts: 331
Joined: Sat Apr 09, 2005 2:08 am
Location: Canada
Contact:

Post by Thanhda »

got some building issue. dont know why.

Code: Select all

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall `/usr/local/pspdev/psp/sdk/../bin/sdl-config --cflags`  -L. -L/usr/local/pspdev/psp/sdk/lib   sdltest.o `/usr/local/pspdev/psp/sdk/../bin/sdl-config --libs` -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpsputility -lpspuser -lpspkernel -o sdltest.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/psp/lib/libSDL.a when searching for -lSDL
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libSDL.a when searching for -lSDL
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/psp/bin/../lib/libSDL.a when searching for -lSDL
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: skipping incompatible /usr/local/pspdev/psp/lib/libSDL.a when searching for -lSDL
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
make: *** [sdltest.elf] Error 1
i set up just as it says in the README.PSP and i get this error when trying to build. dont know why.
There are 10 types of people in the world: Those who understand binary, and those who don't...
ufoz
Posts: 86
Joined: Thu Nov 10, 2005 2:36 am
Location: Tokyo
Contact:

Post by ufoz »

I just spent some time getting SDL to work, maybe it should be noted in the README.PSP file that the SDL_main function needs to have

Code: Select all

extern "C"
linkage if you're compiling C++ code, otherwise my psp-g++ threw a hissy fit about an undefined reference.
Post Reply