linux 下 SDL 搭建

Source downloaded from :  http://www.libsdl.org/

 

INSTALL:

./configure

make

sudo make install

 

Test code:

#include "SDL.h"   /* All SDL App''''s need this */
#include

int main() {

printf("Initializing SDL./n");

/* Initialize defaults, Video and Audio */
if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
printf("Could not initialize SDL: %s./n", SDL_GetError());
exit(-1);
}

printf("SDL initialized./n");

printf("Quiting SDL./n");

/* Shutdown all subsystems */
SDL_Quit();

printf("Quiting..../n");

exit(0);
}


compile:
gcc -o initializing test.c -I/usr/local/include/SDL -lSDL

你可能感兴趣的:(SDL)