Lazy Foo' Productions

SDL Forums external link SDL Tutorials Articles OpenGL Tutorials OpenGL Forums external link
Follow BlueSky Follow Facebook Follow Twitter Follow Threads
Donate
News FAQs Contact Bugs

Setting up SDL Extension Libraries on Linux

Last Updated: Feb 2nd, 2015

Since there are so many flavors of Linux these tutorials might not work on your Linux set up. If you've tried everything and are still having problems, contact me and I'll try to add on a distro specific fix.
In the age of packaging managers, a lot of the work is done for you when installing libraries. You'll need root privileges to install packages so make sure to use "su" or "sudo" if you're not logged in as root.

Make sure you have updated to the latest version of your distro because your older package manager may not support the latest version of SDL_image/SDL_ttf/SDL_mixer.

1) For those of you who have Advanced Packaging Tool available (ie Ubuntu and Debian) you'll want to search the apt-get cache to find the current SDL_image version to install. You can search the apt-get available packages using the command:

apt-cache search libsdl2-image

You'll want to download the development version of SDL_image. As of the last update of this tutorial, the development package of SDL_image is libsdl2-image-dev. You can install this package using the command

apt-get install libsdl2-image-dev

For SDL_ttf, the development package name is libsdl2-ttf-dev. For SDL_mixer it's libsdl2-mixer-dev.

2) If you use the Yellow dog Updater, Modified (used in Fedora and CentOS) you can enter the command:

yum search SDL2_image-devel

To search for the SDL_image developers package. As of the last update of this tutorial, the developer package for SDL 2 is SDL2_image-devel. You can install this package using the command:

yum install SDL2_image-devel

For SDL_ttf, the development package name is SDL2_ttf-devel. For SDL_mixer it's SDL2_mixer-devel.

3) If somehow you don't have a package manager, you can install from the source the classic Unix way. Download the latest source from the SDL_image website.
sdl2 source download page

Extract the archive and cd to the folder that got extracted. Configure the installation using

./configure

Compile the source using the make command

make all

Finally, install the package using the make command

make install

4) Now that you've installed the development libraries, it's time to start up your IDE/compiler.
Select Your Compiler/IDE
Setting up SDL Extension Libraries on Code::Blocks 13.12
Setting up SDL Extension Libraries on Code::Blocks 13.12
Setting up SDL Extension Libraries on g++
Setting up SDL Extension Libraries on g++