Skip to content

Instantly share code, notes, and snippets.

@gszauer
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gszauer/9266241 to your computer and use it in GitHub Desktop.
Save gszauer/9266241 to your computer and use it in GitHub Desktop.
Install SDL2
---
title: "Installing SDL2 on Ubuntu for Game Development"
tags: sdl2, game programming
---
Here are the steps I took to install SDL2 on Ubuntu 13.04 from the source:
1. Download the SDL 2.0.0 source:
http://www.libsdl.org/release/SDL2-2.0.0.tar.gz
2. Untar the source
```
tar xvf SDL2-2.0.0.tar.gz
```
3. `cd` into the repo
```
cd SDL2-2.0.0.tar.gz
```
4. Execute configure
```
./configure
```
5. Run `make`
```
make
```
6. Run `make install`
```
sudo make install
```
You should be all set to work with SDL2.
Don't forget to do the same for the other components of SDL you want to
work with:
* [SDL_image](http://www.libsdl.org/projects/SDL_image/) - for working with images
* [SDL_mixer](http://www.libsdl.org/projects/SDL_mixer/) - for working with audio
* [SDL_net](http://www.libsdl.org/projects/SDL_net/) - for working with networking
* [SDL_ttf](http://www.libsdl.org/projects/SDL_ttf/) - for working with TrueType Fonts
The process for installing them is the same, download the source and run
the same commands as above.
[SDL projects and libraries live here.](ttp://www.libsdl.org/projects/)
Note: if you are having issues getting SDL2 to compile on your machine
with a GPU, you may need to install the following packages:
```
sudo apt-get install build-essential xorg-dev libudev-dev libts-dev libgl1-mesa-dev libglu1-mesa-dev libasound2-dev libpulse-dev libopenal-dev libogg-dev libvorbis-dev libaudiofile-dev libpng12-dev libfreetype6-dev libusb-dev libdbus-1-dev zlib1g-dev libdirectfb-dev
```
Reload libraries
```
sudo /sbin/ldconfig
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment