SDL (Simple DirectMedia Layer) - Getting started in Linux

Install the development libraries of SDL from the official repositories of your Linux distribution.

Terminal edit

$ gcc sdl.c -o sdl -lSDL2

The argument -lSDL2 means after compiling sdl.c with gcc, the binary sdl, named using the -o argument, is linked to the SDL 2 runtime libraries.

NOTE: Linking the binary to SDL 1.2 libraries requires the -lSDL argument.

To continue using the terminal to build your source, you can use GNU Make, CMake or a plain Makefile.

Code::Blocks edit