Attention linker "experts":

I have tried compiling a pascal program using the freepascal 2.2.0 cross-compiler I made and using some updated SDL libraries, including an updated SDL_Mixer that uses libmad and trembor? for no floating-point usage.

At the linking stage I get these errors:

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'
Does this mean I have something in the wrong order in the linking process?

My linking line in the batch file:

Code:
arm-linux-ld.exe  -static --no-warn-mismatch --reduce-memory-overheads --gc-sections -s -L. -o%1.gpe link.res -lpng -lm -lstdc++ -lgcc_eh -lpthread -lvorbisidec -lmikmod -lpng12 -lz -lSDL -ljpeg -lfreetype -lc -lgcc
cheers,
Paul.