email sol follow sol rss feed of the blog wishlist Sol::Tutorials

Sol's Graphics for Beginners

01 - Setting Up SDL in Linux

(other platforms)

These instructions (by Larry Reznick) do not cover exactly everything that is covered by the other platform chapters, so you may wish to read through some other chapter as well.

Linux does not currently have a "preferred" IDE, so you may need to improvise a bit when the tutorial speaks about IDE tasks.

(If your distribution doesn't use RPMs, you may wish to try the same tasks with your distribution's package management system).

  1. There may be an SDL library present on your Linux system in /usr/lib and header files in /usr/include/SDL. Chances are they're older than the latest stable release. You can check your SDL installation with "rpm -q SDL" or all possible variations with "rpm -qa | grep SDL". You may want to use rpm to remove this. I didn't need to.
  2. Download the latest SDL tarfile. (I always install from source tarfiles, not RPMs.)
  3. Change to the directory in which you want to extract the SDL source subdirectory.
  4. Extract the data using tar, such as with "tar -xvzf SDL-1.2.8.tar.gz".
  5. Change to the subdirectory just created for the SDL source.
  6. Check the configure options using "./configure --help" and note any options relevant to your needs.
  7. Run "configure" with any options needed.
  8. Run "make" to build the software.
  9. Switch to the root user and run "make install".
  10. If /etc/ld.so.conf doesn't have "/usr/local/lib" in it, and no files exist in /etc/ld.so.conf.d, either add that "/usr/local/lib" line to the file, or write a /etc/ld.so.conf.d/local.conf file containing that "/usr/local/lib" line.
  11. Run "ldconfig".
  12. Enjoy SDL.

The tutorial assumes that you're using some kind of IDE, and that every chapter's project is in its own directory (starting from folder called ch01), and that there's a main source file called main.cpp.

After creating those, you are ready for 02 - SDL Skeleton and Putting Pixels..

Having problems? Try the forums!

Any comments etc. can be emailed to me.

Site design & Copyright © 2017 Jari Komppa
Possibly modified around: April 29 2010