Installing Allegro in Code::Bocks - It shouldn't be this hard!
nshade

I decided to resurrect some of my very old Allegro code I did in Linux years ago. I'm using Allegro 5 and though it would be a piece of cake to get it going under windows..

Installing Allegro in Windows is an unmitigated disaster...

I have have Code::Blocks 16.01
I have MinGW 4.9.2 (The one that comes with Code::Blocks)

The info located at https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5
is not very helpful.

The instructions are way out of date and when I tried to add allegro to my already active project I got nothing but compiler and linker errors.

Can help clear up what exactly is the correct way of doing this?

=====

OK so I just tried to bite the bullet and do a full build of allegro from scratch. I uninstalled Code::Blocks entirely and I followed these instructions..

https://wiki.allegro.cc/index.php?title=Install_Allegro5_From_Git/Windows

Yea these instructions are garbage too.

I can compile the dependencies, but actually compiling Allegro fails

ISSUES I FOUND.

From install of MinGW
----
Select the following components when prompted

C Compiler
C++ Compiler
MSYS basic system
----
You are not prompted for this. You have to select "mingw32-base" "mingw-gcc-g++" and "msys-base" from an installer application

Cmake... Install 32 bit? 64 bit? does it matter?

DUMB:
----
3. Enter "M" to select MinGW and "N" to say no to Allegro support (they mean Allegro 4, which we are not interested in)
----
I was never prompted for this...

From the Allegro instructions...
git checkout 5.2 <---- These is no 5.2 branch 5.2.0? 5.2.1? 5.2.2? Master?

and of course compile errors ...

C:\devel\Allegro5\src\file_stdio.c: In function 'file_stdio_ferrmsg':
C:\devel\Allegro5\src\file_stdio.c:298:7: error: unknown type name 'errno_t'
errno_t rc = strerror_s(userdata->errmsg, sizeof(userdata->errmsg),
^~~~~~~
CMakeFiles\allegro.dir\build.make:612: recipe for target 'CMakeFiles/allegro.dir/src/file_stdio.c.obj' failed
mingw32-make[2]: *** [CMakeFiles/allegro.dir/src/file_stdio.c.obj] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/allegro.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/allegro.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

Did I miss something?

Edgar Reynaldo

Hello nshade.

Installing from binaries

The page at https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5 tells you exactly what you need to know if you read it carefully enough.

Step 1. Working MinGW install.
Your problem : You're using MinGW 4.9.2. There are no binaries for Allegro 5 for a version of MinGW that is so out of date. On the page linked above, there are links for installing a current modern version of MinGW.

See here :
https://wiki.allegro.cc/index.php?title=Installing_MinGW

Step 2. Download Allegro binaries that match the exact version of your MinGW compiler. Not all compilers have binaries available! Our resources are limited as far as binary distros are concerned. If you download the MinGW compiler and the binaries from here : https://wiki.allegro.cc/index.php?title=Unofficial_MinGW_Binaries you will have everything you need to compile an Allegro 5 program.

Step 3. Configure your CodeBlocks project as shown in the first link.

Step 4. Report what went wrong. Tell me the exact steps needed to reproduce the problem you are having.

EDIT

Compiling Allegro itself

As I said before, MinGW.org is out of date. They are severely behind everyone else in terms of features and modern C and C++ support. Don't use MinGW from there. Use TDM-GCC or MinGW-W64 or MSYS2 or something.

As for this page (https://wiki.allegro.cc/index.php?title=Install_Allegro5_From_Git/Windows) it is out of date, and for that I apologize. I'll try to update it over the next few days. For now, just use the binaries.

nshade

I didn't me to come off as a Bratty Betty. I was just getting super frustrated.

I used the MinGW in the instructions, which is MinGW 6.3.0 but it looks like it's just the 32 bit version.

You may want to update that link to https://sourceforge.net/projects/mingw-w64/?source=directory

which is the 64 bit version.

You know what. I'm on a mission now.. I'm going to compile this thing from scratch and get it running in Code::Blocks even if it kills me :) Step 1 will be wiping my devel envornment again and giving it another go with MinGW-64

As a note - There are some packages in the a A5_Sourcepackage.zip that already have a "build" folder in them. these need to be renamed to "build.old" and a new empty build folder created.

Once I get the build proecess down, I will be making a Youtube video of this for others.

Edgar Reynaldo

If you're going to compile allegro 5, let me help you out. The source deps package is way out of date. There are bugs in physfs, and libtheora, as well as dynamic build script problems with enet. Let me upload a new source pack with all the updated dependencies source code. Give me a few minutes to put it together.

This is the correct directory to download mingw from :
https://sourceforge.net/projects/mingw-w64/files/?source=navbar

Here is a new archive of the A5 source dependency source code :
https://www.allegro.cc/files/attachment/611026

EDIT
You want to checkout 'master' branch from GIT, or 5.2.2 .

Thread #617029. Printed from Allegro.cc