Compiling statically

Hi, I want to build a binary for GNU/Linux and I need to compile SDL
statically.

I use sdl-config --static-libs and that works fine but I’m also using
SDL_mixer, SDL_net and SDL_ttf and I don’t know exactly what libraries
they use so when I compile I get a lot of undefined symbols like these:

/usr/lib/libSDL_ttf.a(SDL_ttf.o): In function TTF_Init': SDL_ttf.o(.text+0x6e): undefined reference toTT_Init_FreeType’

/usr/lib/libSDL_mixer.a(mixer.o): In function mix_channels': mixer.o(.text+0x2f1): undefined reference toSDL_MixAudio’

/usr/lib/libSDL_mixer.a(mixer.o): In function Mix_LoadWAV_RW': mixer.o(.text+0x908): undefined reference toSDL_LoadWAV_RW’
mixer.o(.text+0x994): undefined reference to `SDL_FreeWAV’

Any help?

Thanks.

Lorenzo

When coming libs into your app statically you need to include the libs
that they require as well. TT_Init_FreeType would be FreeType needing to
be inclucedf, and the SDL_MixAudio errors are probably because you
listed SDL_mixer after SDL.

I believe that’s how it works.

  • chrisOn Fri, 2002-05-17 at 09:42, Lorenzo Gil-Sanchez wrote:

Hi, I want to build a binary for GNU/Linux and I need to compile SDL
statically.

I use sdl-config --static-libs and that works fine but I’m also using
SDL_mixer, SDL_net and SDL_ttf and I don’t know exactly what libraries
they use so when I compile I get a lot of undefined symbols like these:

/usr/lib/libSDL_ttf.a(SDL_ttf.o): In function TTF_Init': SDL_ttf.o(.text+0x6e): undefined reference toTT_Init_FreeType’

/usr/lib/libSDL_mixer.a(mixer.o): In function mix_channels': mixer.o(.text+0x2f1): undefined reference toSDL_MixAudio’

/usr/lib/libSDL_mixer.a(mixer.o): In function Mix_LoadWAV_RW': mixer.o(.text+0x908): undefined reference toSDL_LoadWAV_RW’
mixer.o(.text+0x994): undefined reference to `SDL_FreeWAV’

Any help?

Thanks.

Lorenzo


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Chris
@Christopher_Thielen