Compile sdl

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.

what does that mean.

looking for your help

cheers________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

You should link with the sdl-libraries while compiling: SDLmain.lib, and
SDL.lib in windows.

Regards,
\Mikkel GjoelOn Tue, 11 Nov 2003, elhadj benkhelifa wrote:

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 BeanOn 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.

hi again

yes i did it , it compiles but the screen doesn’t stay
when i run the program.

what does that mean?

the code i am testing is the one provided in SDL Doc,
initializing video.

thanks again________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

Try adding:

SDL_Delay(5000);

This will pause for 5 seconds so you can see what is happening. It may
be the case you are opening the display, then closing it quickly.

David BeanOn Tue, 2003-11-11 at 15:36, elhadj benkhelifa wrote:

hi again

yes i did it , it compiles but the screen doesn’t stay
when i run the program.

what does that mean?

the code i am testing is the one provided in SDL Doc,
initializing video.

thanks again

hello,

yes i tried the SDL_Delay, and it works like you said.
but how can i fix the problem now.

thanks for help

— David Bean wrote: > On
Tue, 2003-11-11 at 15:36, elhadj benkhelifa> wrote:

hi again

yes i did it , it compiles but the screen doesn’t
stay
when i run the program.

what does that mean?

the code i am testing is the one provided in SDL
Doc,
initializing video.

thanks again

Try adding:

SDL_Delay(5000);

This will pause for 5 seconds so you can see what is
happening. It may
be the case you are opening the display, then
closing it quickly.

David Bean


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


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk