Pages

Friday, May 3, 2013

A C++ Library that lives up to it's name (sort of)

Hello again. You remember me, right? Of course you do!

You wouldn't be here otherwise.

Recently, I've been tasked with developing an educational game as a 3rd Year Computer Science Project. It also happens to be a group project, which helps with the workload. However, it has to be done in C++.

<sarcasm> Great </sarcasm>

If those HTML tags don't work for you, you should try updating your browser.*

Now, for a group of students who spent a majority of their high school and university career developing in Java - being thrown into the deep end with a language that has no native libraries for simple media processing and GUI creation sounds like development hell. It is, especially when you have just over a month to complete it (don't forget other projects and tests being  thrown into the mix!).

We were cut some slack, though. We have the freedom of choosing our own IDE and libraries to use for our project, which should make our lives easier. So, after much research and debate, we narrowed the possibilities down to three options:

  1. Visual C++ 2010
  2. QtCreator
  3. SFML
The first option would have been great. Until we realised that we are developing in Linux (more specifically, Fedora 14). So we threw Visual out the window. Splat.
QtCreator was our next option. It looked promising, but at the end of it all, we learned that it's commercial software and we have to BUY it. The trial version lasts 30 days. That's less than our expected development time and we didn't want to take any risks. 

So, we were left with SFML. It looks promising, and we can use it to create a rather pleasant looking game with sprites instead of fancy coloured GUI components. The problem that arose with SFML, however, was setting it up.

No matter how closely we followed the tutorials, we always ended up with either an executable that refused to execute (in some rare cases, it would execute but crash immediately) or the IDE would not be able to find the library at all. Many people around the world (even some of my fellow classmates who wanted to use the library for their game) have a similar issue, but what boggles me is that others have managed to get it to work.  

I've used the MingW version with Code::Blocks and Eclipse, to no avail. On Windows 8 it compiles but the executable is broken. On Ubuntu 10.10 and Fedora 14, both IDE's can't find the libraries, even after we've added them to the libs and the linker. The other option was with Visual C++ 2008, so I tried the SFML version of that as well. The results were still the same.

I refuse to give up on this. I've been working with SFML 1.6, so I think I should try 2.0 next time. After I compile it from source, that is. I'm also going to try this in Windows 7, using a slightly older and less buggy version of Eclipse. 

I shall have results tomorrow, and I shall make a note of them here. If I get it to work, I will post a nice little tutorial on how I managed to get it working. If you managed to figure out the relevance of the title of this post with some of it's content, a million points to you.

*I was being sarcastic here, too.

No comments:

Post a Comment