forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SDL_Mixer Problem

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Garak



Joined: 27 Jul 2005
Posts: 46

PostPosted: Mon Dec 12, 2005 6:41 am    Post subject: SDL_Mixer Problem Reply with quote

Hello,

I recently tried to use SDL mixer in my SDL app, and I am getting an error. I installed the latest version from the SVN, built and installed it. I am using cygwin and the bash shell to install. When installing, I received the following error:

checking for C compiler default output file name... configure: error: C compiler
cannot create executables
See `config.log' for more details.

I ran this version of configure, just as it appears in reame.psp:

LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" ./configure --host psp --with-sdl-prefix=`psp-config --psp-prefix` --disable-music-mp3 --prefix=`psp-config --psp-prefix`

I went to an old SDL checkout I had, and found the older command to run configure was as follows:

LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser -lpsputility" ./configure --host psp --with-sdl-prefix=`psp-config --psp-prefix` --disable-music-mp3 --prefix=`psp-config --psp-prefix`

The second command worked and installed SDL_mixer correctly. It only differs from the first in that it has the "-lpsputility" option.

When I try to use SDL mixer in a program, I get the following errors:
>make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall `/usr/local/pspdev
/psp/sdk/../bin/sdl-config --cflags` -DNOUNCRYPT -c -o sp.o sp.c
sp.c: In function 'SDL_main':
sp.c:157: warning: passing argument 1 of 'SDL_CreateThread' from incompatible pointer type
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall `/usr/local/pspdev
/psp/sdk/../bin/sdl-config --cflags` -DNOUNCRYPT -L. -L/usr/local/pspdev/psp/sd
k/lib sp.o hero_manager.o sprite_manager.o map_manager.o bg_manager.o power_ma
nager.o zip_manager.o unzip.o ioapi.o image_manager.o dl_manager.o `/usr/local/p
spdev/psp/sdk/../bin/sdl-config --libs` -lm -lSDL_gfx -lSDL_image -lSDL_mixer -l
png -lz -lm -ljpeg -lpspwlan -lpspgu -lpsppower -lpspdebug -lpspdisplay -lpspge
-lpspctrl -lpspsdk -lc -lpsputility -lpspuser -lpspkernel -o sp.elf
/usr/local/pspdev/psp/lib/libSDL_mixer.a(mixer.o): In function `mix_channels':
/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/mixer.c:207:
undefined reference to `SDL_MixAudio'
/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/mixer.c:231:
undefined reference to `SDL_MixAudio'
/usr/local/pspdev/psp/lib/libSDL_mixer.a(mixer.o): In function `Mix_LoadWAV_RW':

/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/mixer.c:433:
undefined reference to `SDL_LoadWAV_RW'
/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/mixer.c:482:
undefined reference to `SDL_FreeWAV'
/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/mixer.c:477:
undefined reference to `SDL_FreeWAV'
/usr/local/pspdev/psp/lib/libSDL_mixer.a(wavestream.o): In function `WAVStream_P
laySome':
/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/wavestream.c:
196: undefined reference to `SDL_MixAudio'
/cygdrive/c/Documents/Computer/psphome/devtools/20051208/SDL_mixer/wavestream.c:
196: undefined reference to `SDL_MixAudio'
collect2: ld returned 1 exit status
make: *** [sp.elf] Error 1


It appears that the installed libraries are somehow pointing to the directory where I compiled/installed SDL_Mixer from (psphome/devtools/20051208/SDL_mixer/). I have no idea how that could be possible. My makefile is as follows:

TARGET = sp
OBJS = sp.o hero_manager.o sprite_manager.o map_manager.o bg_manager.o power_manager.o
OBJS += zip_manager.o unzip.o ioapi.o image_manager.o dl_manager.o


INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP kxploit
EXTRA_CLEAN = my-clean

PSP_EBOOT_TITLE = SP
PSP_DIR_NAME = SDLTEST

PSPSDK=$(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
CFLAGS += `$(PSPBIN)/sdl-config --cflags` -DNOUNCRYPT
LIBS = `$(PSPBIN)/sdl-config --libs` -lm -lSDL_gfx -lSDL_image -lSDL_mixer -lpng -lz -lm -ljpeg -lpspwlan -lpspgu -lpsppower
include $(PSPSDK)/lib/build.mak

Does anyone have any idea why I am getting these weird compiler errors when trying to compile a program using SDL_Mixer? Could it have something to do with ./configure not running correctly using the newer version from the latest SDL_Mixer's readme.psp? Any help is appreciated!

Garak
Back to top
View user's profile Send private message Send e-mail AIM Address
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Dec 12, 2005 6:59 am    Post subject: Reply with quote

You need to update Newlib as it's way old. Then move the -lSDL_mixer library before the SDL libraries since it depends on them (same for SDL_image).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group