Thursday, March 1, 2012

How to install and start working with SFML on Ubuntu

The easiest way to install SFML on Ubuntu is with a terminal (the name of my blog lied to you) 

Open up a terminal (push "Control + Alt + T" at the same time or just find it in the menu)

Then copy and paste this inside the terminal
  • sudo apt-get install libsfml* libglu1-mesa-dev geany

You will also need build-essential if you haven't already installed that 
  • sudo apt-get install build-essential 

Now find and open up Geany and click on "Build" then "Set Build Commands" and copy'n'paste the following in "build"
  • g++ -Wall -o "%e" "%f" -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system
and click ok.
This is how Geany should look.
That's it you should now be able to use geany to compile and execute any of the files I put on this blog and of course any other programs you wish to compile and execute with SFML.

Check out this link for a free open source game made by me that you can play/test/build/modify/whatever else you want to do to this game. Have a look at it in the video below.



Have fun! 

1 comment: