Compiling the Gosu Game Development Library on Ubuntu Feisty

Posted by Ryan Baxter Wed, 21 Nov 2007 01:40:00 GMT

I’ve had the itch this week to try out a few of Ruby’s game development libraries. I decided to start with Gosu. Gosu is a 2D game development library for the Ruby and C++ programming languages. It’s available for the Mac OS X, Windows, and Linux platforms and integrates with both the RMagick image processing library and the Chipmunk physics library.

Unfortunately the library is only available as a gem for Mac OS X and Windows. As a Linux user I’ve become accustom to compiling my own libraries, but this often means downloading and compiling dependencies, swearing, and a lot of Googling. I was lucky. Compiling Gosu only caused a few hairs to fall out.

If you’re an Ubuntu Feisty user, you’ll need to add the following line to the LargeImageData.hpp file located in the gosu-source-0.7.7/Gosulmpl/Graphics directory:

#include <boost/none.hpp>

This line adds a reference needed on line 31 of the LargeImageData class. With this addition, you can then execute the commands below from the gosu-source-0.7.7/linux directory to compile the Gosu game development library.

$ autoconf
$ ./configure
$ make

The make file provided with the source does not add the compiled gosu.so file to the Ruby lib directory. I chose to do this manually rather than edit the make file. Just issue the following command from the gosu-source-0.7.7/linux directory to add your newly compiled library.

$ sudo cp gosu.so /usr/lib/ruby/1.8/i486-linux/gosu.so

With a little elbow grease I successfully compiled the Gosu game development library on Ubuntu Feisty. I’ll dig into some tutorials next and post back with my results.

Be sure to check out Gosu’s, Getting Started on Linux, for a list of dependencies and compilation instructions.

Comments

Leave a response

Avatar
Ryan Baxter Comment_bubble 14 days later:
Julian has committed this fix!