[SDL] compile sdl

David Bean sdl at dbean.uklinux.net
Tue Nov 11 07:10:01 PST 2003

On Tue, 2003-11-11 at 14:14, elhadj benkhelifa wrote:
> hi all, 
> i am new to sdl, i am trying to compile the example
> given in the sdl documentation for video. 
> i included the SDL.h file but when compile i got
> undefined reference to for example SDL_Init(),
> SDL_Quit ...and so on. 
I need this line at the top of the source file:

#include <SDL/SDL.h>

I also have to select the SDL library when ompiling with this parameter:

g++ Test.cpp -lSDL

You will also have to make sure that the SDL headers are installed on
your system. Mine are in a seperate package called "libsdl1.2-dev". You
can check this by looking in the include directory for the SDL.h

Good luck

David Bean

More information about the SDL mailing list