Gentoo Wiki


To develop SDL programs, it is not necessary to download development libraries as stated in SDL's main page. As long as libsdl is installed

emerge libsdl

You can link to it.

gcc program.c -lSDL

Same goes with other SDL helper libraries, such as sdl-mixer:

gcc program.c -lSDL -lSDL_mixer

One thing you should keep in mind though, is that in most code examples you will see:

include "SDL/SDL.h"

which assumes you have the libraries in your development directory. Just do:

include <SDL/SDL.h>

instead and it will work.

Perhaps there is a good reason to get the development libraries (and if so, it should be added here), but, at least in Gentoo, you can still make programs without them.

External Links

Retrieved from ""

Last modified: Fri, 05 Sep 2008 23:04:00 +0000 Hits: 415