How to install all SDL libraries in Ubuntu 14.04?

dpkg -l | grep sdl

This command gives me the following detail:

ii  libsdl1.2debian:i386                                        1.2.15-8ubuntu1.1                                   i386         Simple DirectMedia Layer

I don't know whether SDL 1.2 is being installed on my system or not? Also, do I need to install sdl image, mixer, ttf etc etc? How to install them?


Solution 1:

For installing it:

sudo apt-get install libsdl2-2.0

and for installing everything necessary to build programs that use SDL:

sudo apt-get install libsdl2-dev

Solution 2:

You can search for all available instances of libsld1.2 with something like the following:

andrew@corinth:~$ apt-cache search ^libsdl | grep 1.2
libsdl1.2-dbg - Simple DirectMedia Layer debug files
libsdl1.2-dev - Simple DirectMedia Layer development files
libsdl1.2debian - Simple DirectMedia Layer
libsdl-image1.2-dbg - Image loading library for Simple DirectMedia Layer 1.2, debugging
libsdl-mixer1.2-dbg - Mixer library for Simple DirectMedia Layer 1.2, debugging
libsdl-net1.2-dbg - Network library for Simple DirectMedia Layer 1.2, debugging
libsdl-gfx1.2-4 - drawing and graphical effects extension for SDL
libsdl-gfx1.2-dev - development files for SDL_gfx
libsdl-gfx1.2-doc - documentation files for SDL_gfx
libsdl-image1.2 - Image loading library for Simple DirectMedia Layer 1.2, libraries
libsdl-image1.2-dev - Image loading library for Simple DirectMedia Layer 1.2, development files
libsdl-mixer1.2 - Mixer library for Simple DirectMedia Layer 1.2, libraries
libsdl-mixer1.2-dev - Mixer library for Simple DirectMedia Layer 1.2, development files
libsdl-net1.2 - Network library for Simple DirectMedia Layer 1.2, libraries
libsdl-net1.2-dev - Network library for Simple DirectMedia Layer 1.2, development files
libsdl-sound1.2 - Sound library for Simple DirectMedia Layer 1.2, libraries
libsdl-sound1.2-dev - Sound library for Simple DirectMedia Layer 1.2, development files
libsdl-ttf2.0-0 - TrueType Font library for Simple DirectMedia Layer 1.2, libraries
libsdl-ttf2.0-dev - TrueType Font library for Simple DirectMedia Layer 1.2, development files
andrew@corinth:~$ 

and then simply install all of the resulting files with something like the following:

sudo apt-get install libsdl1.2debian libsdl-gfx1.2-5 \
libsdl-gfx1.2-dev libsdl-gfx1.2-doc libsdl-image1.2 \
libsdl-image1.2-dbg libsdl-image1.2-dev libsdl-mixer1.2 \
libsdl-mixer1.2-dbg libsdl-mixer1.2-dev libsdl-net1.2 \
libsdl-net1.2-dbg libsdl-net1.2-dev libsdl-sound1.2 \
libsdl-sound1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev

You can easily leave some out such as the .dbg files which are simply debugging extras and you will not need the -dev files unless you are compiling. Some will also be dependencies of the others as well and will be automagically installed with installation of one of these files...

Solution 3:

You can do this:

sudo apt-get install libsdl1.2-dbg

Or download the SDL source code to compile and install:

Download SDL

tar xvf SDL-1.2.tar.gz
cd SDL-1.2
./configure
make
sudo make install