I’m doing a project with SDL and this is the line I use with gcc for
static linking:
STATICLIBS = -static -L/usr/lib -lSDL -lpthread -lm -L/usr/X11R6/lib
-lX11 -lXext -ldl -L/usr/lib -lSDL_net -lSDL_ttf -lttf -lSDL_mixer -lesd
-laudiofile -lsmpeg -lvorbisfile -lvorbis -logg -lslang -lgpm -lncurses
-laa -lc
$(PROJECT): $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $(OBJ) $(STATICLIBS)
In my Debian Woody system I get the following link errors:
/usr/lib/libSDL_mixer.a(mixer.o): In function mix_channels': mixer.o(.text+0x2f1): undefined reference to
SDL_MixAudio’
mixer.o(.text+0x387): undefined reference to SDL_MixAudio' /usr/lib/libSDL_mixer.a(mixer.o): In function
Mix_LoadWAV_RW’:
mixer.o(.text+0x908): undefined reference to SDL_LoadWAV_RW' mixer.o(.text+0x994): undefined reference to
SDL_FreeWAV’
mixer.o(.text+0x9ea): undefined reference to SDL_FreeWAV' mixer.o(.text+0xa09): undefined reference to
SDL_FreeWAV’
/usr/lib/libSDL_mixer.a(music_ogg.o): In function OGG_playAudio': music_ogg.o(.text+0x330): undefined reference to
SDL_MixAudio’
/usr/lib/libsmpeg.a(mpegtoraw.lo): In function Play_MPEGaudio(MPEGaudio *, unsigned char *, int)': mpegtoraw.lo(.text+0xac4): undefined reference to
SDL_MixAudio’
mpegtoraw.lo(.text+0xb2d): undefined reference to `SDL_MixAudio’
which seems to be a problem with SDL_mixer
Anybody knows which libraries do i have to include and the order I have
to put them for gcc?
Thanks
Lorenzo Gil Sanchez