Problem with sdlmixer

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
belek666
Posts: 19
Joined: Mon Apr 14, 2008 12:54 am

Problem with sdlmixer

Post by belek666 »

Hello,
I've problem with compiling some sdl code for ps2. This is the output of error:

Code: Select all

$ make
ee-gcc -D_EE -O2 -G0 -Wall  -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/p
s2dev/ps2sdk/common/include -I. -I/usr/local/ps2dev/ps2sdk/sbv/include -I/usr/lo
cal/ps2dev/ps2sdk/ports/include/SDL -I/usr/local/ps2dev/ps2sdk/ports -I/usr/loca
l/ps2dev/ps2sdk/ports/include -c main.c -o main.o
ee-gcc -D_EE -O2 -G0 -Wall  -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/p
s2dev/ps2sdk/common/include -I. -I/usr/local/ps2dev/ps2sdk/sbv/include -I/usr/lo
cal/ps2dev/ps2sdk/ports/include/SDL -I/usr/local/ps2dev/ps2sdk/ports -I/usr/loca
l/ps2dev/ps2sdk/ports/include -c ps2.c -o ps2.o
ps2.c: In function `IOP_reset':
ps2.c:28: warning: implicit declaration of function `SifExitIopHeap'
bin2s irx/usbd.irx obj/usbd_irx.s usbd_irx
ee-as -G0  obj/usbd_irx.s -o obj/usbd_irx.o
bin2s irx/usbhdfsd.irx obj/usbhdfsd_irx.s usbhdfsd_irx
ee-as -G0  obj/usbhdfsd_irx.s -o obj/usbhdfsd_irx.o
bin2s irx/ps2kbd.irx obj/ps2kbd_irx.s ps2kbd_irx
ee-as -G0  obj/ps2kbd_irx.s -o obj/ps2kbd_irx.o
bin2s irx/ps2mouse.irx obj/ps2mouse_irx.s ps2mouse_irx
ee-as -G0  obj/ps2mouse_irx.s -o obj/ps2mouse_irx.o
ee-gcc -mno-crt0 -T/usr/local/ps2dev/ps2sdk/ee/startup/linkfile -L/usr/local/ps2
dev/ps2sdk/ee/lib -L/usr/local/ps2dev/ps2sdk/sbv/lib -L/usr/local/ps2dev/ps2sdk/
ports/lib \
        -o bin/sdl.elf /usr/local/ps2dev/ps2sdk/ee/startup/crt0.o main.o ps2.o o
bj/usbd_irx.o obj/usbhdfsd_irx.o obj/ps2kbd_irx.o obj/ps2mouse_irx.o -lpatches -
lc -ldebug -lsdlmain -lsdl -lsdlmixer -lc -lkernel
C:/msys/1.0/local/ps2dev/ps2sdk/ports/lib\libsdlmixer.a(wavestream.o)(.text+0x31
8): In function `WAVStream_PlaySome':
wavestream.c: undefined reference to `SDL_MixAudio'
C:/msys/1.0/local/ps2dev/ps2sdk/ports/lib\libsdlmixer.a(mixer.o)(.text+0x318): I
n function `mix_channels':
mixer.c: undefined reference to `SDL_MixAudio'
C:/msys/1.0/local/ps2dev/ps2sdk/ports/lib\libsdlmixer.a(mixer.o)(.text+0x3fc):mi
xer.c: undefined reference to `SDL_MixAudio'
C:/msys/1.0/local/ps2dev/ps2sdk/ports/lib\libsdlmixer.a(mixer.o)(.text+0x9d8): I
n function `Mix_LoadWAV_RW':
mixer.c: undefined reference to `SDL_LoadWAV_RW'
C:/msys/1.0/local/ps2dev/ps2sdk/ports/lib\libsdlmixer.a(mixer.o)(.text+0xa58):mi
xer.c: undefined reference to `SDL_FreeWAV'
C:/msys/1.0/local/ps2dev/ps2sdk/ports/lib\libsdlmixer.a(mixer.o)(.text+0xab8):mi
xer.c: undefined reference to `SDL_FreeWAV'
make: *** [bin/sdl.elf] Error 1
Makefile:

Code: Select all


EE_BIN   = bin/sdl.elf
EE_OBJS  = main.o ps2.o obj/usbd_irx.o obj/usbhdfsd_irx.o obj/ps2kbd_irx.o obj/ps2mouse_irx.o


EE_LIBS += -lpatches -lc -ldebug -lsdlmain -lsdl -lsdlmixer
EE_INCS :=  -I$(PS2SDK)/sbv/include -I$(PS2SDK)/ports/include/SDL
EE_LDFLAGS := -L$(PS2SDK)/sbv/lib -L$(PS2SDK)/ports/lib

all: $(EE_BIN)
	 ps2_packer/ps2_packer bin/sdl.elf bin/packed_sdl.elf
clean:
	rm -f *.o bin/*.elf *.S *.s http obj/*.o obj/*.s *.o 	

obj/usbd_irx.s:
	bin2s irx/usbd.irx obj/usbd_irx.s usbd_irx
obj/usbhdfsd_irx.s:
	bin2s irx/usbhdfsd.irx obj/usbhdfsd_irx.s usbhdfsd_irx
obj/ps2kbd_irx.s:
	bin2s irx/ps2kbd.irx obj/ps2kbd_irx.s ps2kbd_irx
obj/ps2mouse_irx.s:
	bin2s irx/ps2mouse.irx obj/ps2mouse_irx.s ps2mouse_irx
	
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
I'm using LBGSHI Pre-Built, Win32 PS2SDK. Thanks for help.
tsomctl
Posts: 5
Joined: Tue Dec 09, 2008 11:43 am

Post by tsomctl »

In your makefile, try changing the order of the libraries in EE_LIBS, eg:

Code: Select all

EE_LIBS += -lpatches -lc -ldebug -lsdlmixer  -lsdlmain -lsdl
I'm not too familiar with sdl, but the order of the libraries can affect how the linker resolves symbols. Also, you might need to link in some other sdl library. Look in /usr/local/ps2dev/ps2sdk/ports/lib for other sdl libraries you might need.
Post Reply