« | Home | »

Installing the Allegro Library under DevC++

Allegro! Easy, right?

A little while ago I become interested in trying my hand at working with a C++ graphics library – perhaps to make a simple game for myself. With minimal effort, and a trip to Google, I discovered Allegro. Allegro is a game programming library for C++, or C, coders. It is freely distributed, and available on Unix, Windows, and MacOS X. The library is renowned for being beginner friendly, and easy to code with. Me, being quite the novice, I decided to give it a try.

To make a long story short, I was not able to complete the ‘installation’ process under the DevC++ IDE. The documentation available for the installation was very involved, and proved to be a little too challenging for me to complete. So much for being beginner friendly! I won’t bore you with what went wrong, but rather, I’ll show you how I got it up and running instead.

If you’re seriously interested in reading this article – I’m going to make the assumption that you’re in the same boat as I was during the install – and that you know what the hell DevC++ is!

Checklist

There are two things we’ll need to complete our Allegro installation.

  1. A working DevC++ install – with mingw.
  2. A brain.

The Process

Installing Allegro for DevC++ turned out to be fairly simple once I was shown the easy route. The Allegro wiki would have you install MingW, copy and paste files into numerous folders, and set linker paths for the compiler in DevC++. You might even have to compile the thing yourself! This is a lot for ‘a beginner’ to handle, especially someone who has never used a third party library in a program before. Fortunately for us, DevC++ has a nifty feature known as a ‘Package manager’. this will allow us to grab something called a ‘devpak’, or development package, from the internet and install it with minimal effort. A devpak is a precompiled version of a library that is much easier to install than the normal source file.

Allegro! Easy, right?

To begin our installation we’ll first need to start up DevC++. If you haven’t already installed the DevC++ IDE, you should probably do so now. Once you’ve got it up and running, you’ll want to navigate to the tools menu, and then to the ‘Check for Updates/Packages…’ tab. See Figure 1.

From the Updates/Packages we’ll need to select a devpak server, and grab the list of available devpaks – and then use the filter to find packs related to Allegro. Once that’s done, you should have a screen similar to figure 2. Now, you’ll want to click the ‘Download Package’ button, and then follow the simple instructions to install the package once it’s downloaded.

You now have a working installation of the allegro library.

Try it out!

To make use of the library, we’ll have to start a new project. To do this, you need to go to the New Project menu. This menu is divided into 3 categories – Basic, Multimedia, and Introduction. To get started with Allegro, we want the Multimedia tab. Now, select ‘Allegro Application (static)’ to begin an allegro project.

…That’s all there is to it. Enjoy.

Similar Posts:

    None Found


About this entry