Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » installing DevC++ MingW + Allegro

This thread is locked; no one can reply to it. rss feed Print
installing DevC++ MingW + Allegro
ing
Member #3,671
July 2003

Hello,

I've had a look around on the forum and done a search to try and find some
help or recommendation on how/what to install.
I used to compile Allegro with MingW to build for DevC++ or something like
that. It used to work like a charm. I don't have this old system any more.
Now I would like to install the same tools on my present system which is
Win XP. My old system was very stable and I really like allegro so I would
like the same stability. But, since there have been quite a lot of changes
and I belive there is no need to do any compling any more - I feel I don't
even know what versions or packages to download any less how to install
the stuff.
Would much appreciate help and advice here.
Make it easy - tell me step by step.

Thanks

BAF
Member #2,981
December 2002
avatar

The build process hasn't changed... download Allegro 4.2, unzip it, fix mingw32, make, and make install. More information in docs/build/mingw32.txt

Leniuch
Member #5,175
October 2004
avatar

Assuming you want to use precompiled binaries here's what you have to do. Find "include" and "lib" directories you downloaded and copy them to the place you've installed mingw in. There are going to be directories with those names already so just say OK to any warnings, and let them copy. After that you only have to link against allegro library and you're there :) But, as BAF has already said, you can still compile it like you used to before.

ing
Member #3,671
July 2003

OK,

As I recalll I had to unzip Allegro to a directory on the C:drive.
Also MingW and DevC++ each had to be on the C:drive.

Now, the mingw32 directory is placed within DevC++. Does the location
of the mingw32 not matter to allegro ?? The only thing inside the mingw32
directory is the lib and bin directories.
So this would be where I should paste the lib and include from Allegro ??
and overwrite the existing lib ?

Where do I put the Allegro directory ?? just on the C:drive as before

BAF I was wondering, probably the best way is still to compile and build.
It would be more tailor made to my machine. But, do I need to install another
MingW or is it enough with just the mingw32 within DevC++ - or do I have
to download another MingW and place on the C:drive ?? Before there were quite a
few packages I had to download apart from Allegro, there was MingW and then
something called a minimialistic mingw -something...and then a directX for
mingw. They all had to be particular versions. Are all these packages not need now ?

SonShadowCat
Member #1,548
September 2001
avatar

preposterus
Member #6,978
March 2006

The other day I downloaded the latest DevCPP (4.9.9.2) and Allegro with DevCPP's Webupdate module, so all of this should be automatic (?). My problem is that I can't compile exemples I find from tutorials, while my personal project in allegro works fine ???

ing
Member #3,671
July 2003

Preposterous,

I'm presently looking into what packages to download. I think I will go
with the compile version. But, with newer versions, this is the difficult
part - knowing what goes with what.

My old system was really great, but I think it's a bit old. I know I had
to download something called fileutils316-ming.
Now I don't know if there is still such a package that has to be included
or if I should just go with a MinGW current version.

About your not being able to comppile the examples. I don't know, but I
think there used to some issues of that kind and that it actually had to
to with the installations.

I wish I was able to find some really clear instructions on exactly what
to download for the newer versions and how to install.

The link above is good, but I already have som instructions that are almost
identical, and which installations work really great, BUT, there is this
minimalistic thingy - which is not mentioned - and it doesn't say much
about the latest versions - so I still don't know.

johnnyc
Member #6,984
March 2006

How I finally got Allegro working with Dev-C++:

Most of this knowledge was gained through various web posts and installation documents, the rest was gained through trial and error . Use this information at your own risk. I will occasionally refer you to outside documents. The main reason for my many failed attempts to get Allegro working with Dev-Cpp was the lack of updated install documents (At least I couldn't find them.) explaining that DirectX files were needed, where to find them, and mostly, how to install them. That's why I'm typing this. I hope this helps some people avoid a difficult installation. The Dev-Cpp, Allegro, and DirectX files that are linked to below are all the programs you'll need to get started with the installation. These are the programs I used at the time of typing this document (3-06-06):

http://bloodshed.net/dev/devcpp.html
Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC 3.4.2

http://alleg.sourceforge.net/wip.html#stable
Under the “Stable branch 4.2.0 source releases” heading, download the all420.zip file. Source code for all platforms in DOS/Windows friendly format. On this same web page, under the “miscellaneous files” heading, download the dx80_mgw.zip file. This file contains the minimal version of the DirectX 8 SDK for MinGW. Only for windows.

1. When installing Dev-Cpp don't use “Dev-C++” as its filename this will cause problems for the programs we're trying to install, use “Dev-Cpp” instead. During the Dev-Cpp installation process you want to select the option to “Remove all previous configuration files” so you'll start with a clean slate as much as possible. I Installed Dev-Cpp to its default directory C:\Dev-Cpp. Don't bother to run Dev-Cpp after you install it.

2. Next we'll put the Allegro file in its proper place. If its in zipped format extract it into a folder of your choosing. Find the “allegro” file contained within, then copy or cut and paste it into the C:\Dev-Cpp folder.

3. Next we'll put the DirectX files in their proper place. If they're in zipped format extract them into a folder of your choosing. Find the “include” and “lib” files contained within, then copy or cut and paste them into the C:\Dev-Cpp folder. It will warn you that these files already exist in this folder. Click on “yes to all”. That's all there is to that.

4. Next we need to set the environment variables. I'm working with Windows XP and that's what I'll be describing. If you need information on how to set these environment variables for another OS, see the following document. http://www.allegro.cc/files/install-devcpp.html. To set the environment variables we need to get to the “System Properties”. The keyboard shortcut for this is the “windows logo + (pause break)” keys. GOTO step 6.

5. If you need an alternative method to get to the “System Properties” you can go through “My Computer”, then click on “Control Panel”. Now you need to have the control panel displayed using the classic view. If you see in the upper left corner “Switch to Classic View” click that. If you see “Switch to Category View” you're already in the correct display mode. Now find the “System” icon and click it.

6. Once you have the “System properties” window up click on the “advanced” tab then the “environment variables” button. Under the “System Variables” heading scroll down until you see a line that begins with the word “Path”. Double click this line and an edit window opens allowing you to edit the “Path” system variable. We want to add a new value to the end of this line. Start by positioning your cursor at the end of this line and enter the following: “ ;C:\Dev-Cpp\bin “ without the quotes. Don't forget the semicolon ( ; ), it tells the system that this is the start of a new variable value. Click on the OK button. Next we want to add a new system variable. Under the “System variables” heading click on the “New” button. For the “Variable name” enter “MINGDIR”. For the “Variable value” enter “C:\Dev-Cpp”, then keep clicking the OK buttons until all the windows are closed. Next reboot the computer so the changed environment settings will take effect.

7. Now we're to the critical steps of compiling and installing Allegro to work with Dev-Cpp. If everything was done correctly up to this point it shouldn't be a problem. The first step is opening a command prompt window. Click on Start, then Run. Type cmd and hit enter. The nice thing about the command prompt in Windows XP is that you can copy and paste its contents to a document making it easy to get help for a problem you may be having. All you have to do is right click on the title bar and it gives you some editing options. It's also easily customizable. By right clicking on the title bar and accessing the properties menu, it will display the customizing options.

8.At the command prompt we need to change our current working directory as follows. Type “ cd c:\dev-cpp\allegro “ without the quotes, and hit enter. This should now be the current working directory displayed in the prompt. We need to be in this directory because the files we want access to are in there. The fix.bat file is in this directory and it's the next file we'll be using. Type the following command “fix mingw32” and hit enter, you should see a "Done!" message. Enter the next command “make”, you will see Allegro being compiled. Enter the next command “make install”, Allegro is now being installed. If you seen any error messages something isn't right and you'll have to review what you've done so far. Otherwise it's time to test the installation to see if we can get a simple program to run. Close the command prompt by entering the command “exit”.

9. Run the Dev-C++ program and configure it using its default options if you're not sure what you want. Now we'll create a project to test our Allegro installation. Click on file\ new\ project. Click “windows application”. Under the “project options” heading select “c project” and click OK. Save the project file in any folder and any name you want. After you do that A code editing window should come up with some default code already in it. Using the editing options “select all” of this code and hit the delete key to get rid of it. Now enter in the following code.

#include "allegro.h"
int main()
{
allegro_init();
allegro_message("Hello World!");
return 0;
}
END_OF_MAIN();

10.Next we need to include the Allegro libraries for this code. Click project\ project options, then click the parameters tab. Now click the “Add Library or Object” button. In the Open window use the “Look in” portion to navigate your way to the C:\Dev-Cpp\lib folder and select the “liballeg.a” file and click OK. Next hit the F9 key to compile and run this bit of code. A save dialog window will come up. Again save the file in any folder and any name you want. If you see a message window that says “ Hello World! ” Click OK on this window to close it. You're ready to rock and roll.

After everything checks out OK, I would suggest using the Dev-Cpp WebUpdate feature to update any installed components that have a newer version available. Go to “tools” then “check for updates/packages”. When the WebUpdate window opens under the “select devpack server” heading you'll need to select devpacks.org. Then click on the “check for updates” button. When the list is finished building it will show the versions of the components that you have installed and the version of any update that is available. You can select an update that you want by clicking the box next to it. This selects it for downloading. Next click on the “download selected” button. You will be prompted to install these files when they're done downloading.

A few closing notes. I'm a noob at all of this and can't answer any technical questions or any other questions beyond what I've already described here. So if you still don't get it to work after reading this there is nothing I can do for you. Sorry! All I could say is, I know how you feel. It took me a week to get this to work. I could also say that I've seen a lot of people trying to help noobs get started on the forums, so don't give up, ask for help.

BAF
Member #2,981
December 2002
avatar

You don't have to reboot to apply the environmental stuff, just close all your cmd/command windows and re-open them.

I'd say follow Ceniza's tutorial (or the one posted above). You may or may not need the minimalistic directx stuff from the Allegro site to get it to compile on mingw.

ing
Member #3,671
July 2003

Johnny,

this is a gret post. Thank You.

I have now got it all to work. I had to read from several
different sources on how to install and then with a bit
of figuring on my own I got it to work.
Mind you, I haven't got the directories where I want them,
but I got allegro to work with DevC++ and that's a good start
and the main thing right now.

Thanks to all who have helped

C Bird
Member #6,854
February 2006

I've never really had trouble with this kind of setup.
step 1. install dev-cpp
step 2. download allegro via the webmodule updater
step 3. goto <new> <project> <multimedia i think> <allegro - static>
step 4. compile with my own code built off of the project framework given

Go to: