The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

Setting up Code::Blocks with Allegro on XP

From Allegro Wiki
Revision as of 19:10, January 20, 2008 by CGamesPlay (talk | contribs) (cat)
Jump to: navigation, search
This article is a stub. Please help Allegro by expanding it.


Setting up Allegro to use in Conjuction with Codeblocks and MinGW32 on Windows XP

This is a guide to getting oneself in a position to make programs which make use of the allegro library. It's aimed at newcomers to game programming and so although it will require a degree of common sense to follow effectively, terms which might be a little obscure will be explained. Also, you might be pleased to know there'll be no comments such as 'but more on that later'. Just follow the steps and things should work out well.

The process involves three steps. The order of Step 1 and Step 2 isn't important but Step 3 can't be done until until Step 2 has.

Before starting out though, a file compression/decompression utility is required.

7-zip can handle all the files involved and is truly freeware.

After clicking this link :- 7-zip download page.

....you should see this :-

7zip tip.png

(without the red arrow). When you see it, click on the link indicated here by the red arrow, to download 7-zip.

Once that's installed you're ready to start.


STEP 1 - Installing the MinGW Compiler

To make allegro programs a C or C++ compiler is required. The allegro library (of functions) is written in C and programs that use it need to be written in C too (or C++). The compiler is crucial. It turns pages of code into resultant programs. Fortunately there's a free compiler going by the name of MinGW. Understanding this acronym involves a history lesson which isn't the focus of this article.

This link :-

MinGW files

takes you to part of a page with 7 download links on it found under the heading :-

              Base System with C++

The following paragraphs basically explain how to download the 7 files in question and extract their contents to C:\MinGW (assuming this folder has been created). Skip it all if you know how to do this.

Click on each link and save each file to your Desktop (or some folder, but the Desktop's the easiest way). Next, because these files are .tgz files and 7-zip can only completely extract them in two stages (first ungzip-ping, then untar-ing) an intermediary folder needs to be made to put the .tars in.

So create a folder on the Desktop, calling it anything you like and then use 7-zip to ungzip each of the 7 files to the folder. If 7-zip is installed, right-clicking on the files will bring up a menu with 7-zip on it. Follow that to Extract files...

Clicking on that will bring up a 7-zip asking for where to extract the files to. Use the little button with three full stops on to browse your way to the folder on the Desktop. Once you've done that, click on OK. Do that for each file. You don't have to browse your way to the Desktop folder after doing one. It should come up if you use the down arrow by the address box.