Many of us seem to struggle with getting A5 to work. I have a new machine and have big difficulties in getting the right libraries working. Before I tell about my lousy attempts, I want to know if there are any guides about how to install A5 on Code:;Blocks and Mingw. The newest binaries of A5 and dependencies seem to have a bit differing file list from those explained on the Wiki here:https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5

There are no up-to-date guides for MinGW, as far as I know. I'm guessing the issue most people run into is that they don't match the mingw distro/version with the ones in the binaries... there's like 3 types of MinGWs out there, and they keep changing gcc versions every few months as well. I'm guessing the main issue, however, is matching the exception handling mechanism and the threads which are the common differences between MinGWs.

Embarrassingly, I don't know which ones the binaries use (it's whatever the default is for MSYS2).

As I wrote, I downloaded allegro-mingw-gcc6.2.0-x64-static-5.2.2. And "C:\gcc --version" tells me that Mingw is 6.2.0.:

C:\Users\admin_johha>gcc --version
gcc (x86_64-win32-sjlj-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\Users\admin_johha>g++ --version
g++ (x86_64-win32-sjlj-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Could the "sjlj-rev1" thing be the problem? If so, where is that explained?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

Now I have a working setup for my Windows 64 with Mingw, c/c++, and Allegro 5.2.2

It was the posix and seh things that was the problem. Though I have a slight clue about what they are, I really missed their importance in choosing the right compiler.

So getting Allegro 5 work on 64 bit for Windows, Code::Blocks and Mingw included the following:

Get the latest Code::Blocks from here: http://www.codeblocks.org/downloads/26You might want to pick one with Mingw, although it will be the wrong version. But the toolchains will probably be named correctly, even though you switch later to a correct Mingw. I installed Code::Blocks to C:\CodeBlocks\.

Get the right Mingw from this page: https://sourceforge.net/projects/mingw-w64/files/Scroll down to the sub-header MinGW-W64 GCC-6.2.0, since 6.2.0 is the version that the latest A5 binaries are built with. Pick the x86_64-posix-seh file and open the package with 7-Zip or a similar unzipper.What I did was I dragged the folder mingw64 from the 7-Zip program window to C:\CodeBlocks\

At this point I checked that Code::Blocks worked with Mingw. In Settings->Compiler settings it should look like this:

All the program files should be found in C:\CodeBlocks\mingw64\bin, if you have to pick them at this point. If you installed Code::Blocks with Mingw, there might be an extra Mingw subdirectory in the path.

Next thing was to download the Allegro 5 stuff from here: http://download.gna.org/allegro/allegro-bin/5.2.2/Pick the file including x64-static in the name. Since it's a .zip, it opens nicely in Windows 7 explorer. Open the include folder and drag the allegro5 folder to C:\CodeBlocks\mingw64\include\ so that allegro5 becomes a sub folder. Open the lib folder and drag all *static.a files into C:\CodeBlocks\mingw64\lib

Next download the Allegro dependencies from here: http://download.gna.org/allegro/allegro-deps/1.5.0/Pick the file including x64 in the name. Open it like you opened the Allegro stuff. Drag all files inside the lib folder into C:\CodeBlocks\mingw64\lib. You don't need the include folder stuff, since all Allegro stuff is already compiled.

To get an Allegro5 project compiling in Code::Blocks, you now have to include all these libraries. Having your project open, go to Project->Project build options, pick Linker settings tab and add the following libraries from C:\CodeBlocks\mingw64\lib. All *static.a files except the *debug-static.a files and the *monolith-static.a.[1]All the dependencies, which are:

Finally there are two library files yet to be included:libstdc++.alibgcc.a

These two I found in C:\CodeBlocks\mingw64\lib\gcc\x86_64-w64-mingw32\6.2.0But instead of adding them to this list of link libraries, the standard way is to include them in the Other linker options (to the right) as:-static-libstdc++-static-libgcc

Since the order of the linked libraries is important, here's a screenshot of the order. Especially vorbisfile and vorbis have their peculiar place in the list. Don't know if it's important, but that's how it's shown in every previous guide.

[to be continued...]The search directories for the compiler and the linker have to be yet set. I have them probably correct, but I won't show them yet, because it might be a bit unorthodox solution. Also all the above might include some details that are not the right way to do it, although it works.

References

All liballeg files can be replaced by the single monolith-static.a file, but I prefered having each one in the list. This will be my A5 template project file and this way I can pick away each library I don't use, to reduce the size of the final single executable file.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.