Compiling Sdl Test Program With Audio Mixer


WhiteDawn

Still Fresh
Joined
Aug 14, 2007
Messages
18
I try to compile guyfawkes SDL test program, but when I do I get this error

CODE


C:/devkitGP2X/lib\libSDL_mixer.a(mp3_mad.o): In function `mad_openFileRW':
mp3_mad.c:(.text+0x1c): undefined reference to `mad_stream_init'
mp3_mad.c:(.text+0x24): undefined reference to `mad_frame_init'
mp3_mad.c:(.text+0x30): undefined reference to `mad_synth_init'
mp3_mad.c:(.text+0xa0): undefined reference to `mad_timer_zero'
C:/devkitGP2X/lib\libSDL_mixer.a(mp3_mad.o): In function `mad_closeFile':
mp3_mad.c:(.text+0xc4): undefined reference to `mad_stream_finish'
mp3_mad.c:(.text+0xcc): undefined reference to `mad_frame_finish'
C:/devkitGP2X/lib\libSDL_mixer.a(mp3_mad.o): In function `read_next_frame':
mp3_mad.c:(.text+0x150): undefined reference to `mad_frame_decode'
mp3_mad.c:(.text+0x17c): undefined reference to `mad_stream_errorstr'
mp3_mad.c:(.text+0x24c): undefined reference to `mad_stream_buffer'
mp3_mad.c:(.text+0x260): undefined reference to `mad_frame_decode'
mp3_mad.c:(.text+0x28c): undefined reference to `mad_timer_add'
mp3_mad.c:(.text+0x2f8): undefined reference to `mad_stream_buffer'
C:/devkitGP2X/lib\libSDL_mixer.a(mp3_mad.o): In function `mad_seek':
mp3_mad.c:(.text+0x384): undefined reference to `mad_timer_set'
mp3_mad.c:(.text+0x390): undefined reference to `mad_timer_compare'
mp3_mad.c:(.text+0x3f4): undefined reference to `mad_timer_compare'
mp3_mad.c:(.text+0x444): undefined reference to `mad_timer_zero'
C:/devkitGP2X/lib\libSDL_mixer.a(mp3_mad.o): In function `mad_getSamples':
mp3_mad.c:(.text+0x5a8): undefined reference to `mad_synth_frame'
C:/devkitGP2X/lib\libSDL_mixer.a(mp3_mad.o): In function `mad_openFile':
mp3_mad.c:(.text+0x820): undefined reference to `mad_stream_init'
mp3_mad.c:(.text+0x828): undefined reference to `mad_frame_init'
mp3_mad.c:(.text+0x834): undefined reference to `mad_synth_init'
mp3_mad.c:(.text+0x8a8): undefined reference to `mad_timer_zero'
make: *** [sdltest.gpe] Error 1



I know this is because of the SDL mixer because it shows up a lot, and by removing all audio tests from the code I can compile it and it runs fine.

Anybody want to help a newb gp2x programmer?
 
Guyfawkes said:
I am not sure where the mp3_mad.o is coming from, I have never seen it before. What setup of devkitgp2x are you using?
is it libmad? I think libmad links into sdl_mixer for MP3 support.

Try this:
-lSDL_mixer -lvorbisidec -lmikmod -lmad
Heres the whole thing:
-static -lSDL_gfx -lSDL_ttf -lfreetype -lSDL_image -ljpeg -lpng12 -lz -lSDL_mixer -lvorbisidec -lmikmod -lmad -lSDL -lgcc -lm -lc -lexpat -lpthread -msoft-float
 
Last edited by a moderator:
Yeah it seems to be libmad from the error message, libmad.a (-lmad on makefile) is usually used but its looking for mp3_mad instead? Maybe it wasn't compiled with it included or something?
 
Guyfawkes said:
Yeah it seems to be libmad from the error message, libmad.a (-lmad on makefile) is usually used but its looking for mp3_mad instead? Maybe it wasn't compiled with it included or something?
It deos seem suspicous, like the library was compilied from scratch. I dont if would waste much more time on it if the thread author doesnt show up with more information.
 
Last edited by a moderator:
Hey, sorry for long reply. I couldn't figure it out last night, but I stubled upon a pre setup ide while browsing the archives and I got the sdl test thingy by guyfawks to compile fine in both w32 and ARM. Thanks for the fast reply though!
 
WhiteDawn said:
Hey, sorry for long reply. I couldn't figure it out last night, but I stubled upon a pre setup ide while browsing the archives and I got the sdl test thingy by guyfawks to compile fine in both w32 and ARM. Thanks for the fast reply though!
So were you trying to build your toolchain before you found the presetup one?
 
Last edited by a moderator:
Pickle said:
WhiteDawn said:
Hey, sorry for long reply. I couldn't figure it out last night, but I stubled upon a pre setup ide while browsing the archives and I got the sdl test thingy by guyfawks to compile fine in both w32 and ARM. Thanks for the fast reply though!
So were you trying to build your toolchain before you found the presetup one?


Nope, I was still using a presetup one, but I guess it was out of date, as the new one I found works fine.
 
Last edited by a moderator:
Back
Top