EDIT 10/29/2016
I've updated MinGW 5.3.0-2 to use mingwrt 3.22.4 to fix several issues when compiling with the C++ 11 standard. Please update your compiler.
EDIT 10/08/2016
I've updated MinGW 5.3.0-2 to use mingwrt 3.22 and the win32api 3.18. This fixes several issues when compiling with the C++11 standard.
EDIT 09/21/2016
Fixed a couple issues with the static binaries for Allegro 5.2.1.1. They were linked dynamically to the CRT instead of statically. That is fixed in release 3. The full list of static link libraries is now included with the distro, as well as the D3D dlls. In addition, I will be uploading a new version of MinGW 5.3.0-2 soon with updated MinGW Runtimes and Win32 APIs as soon as their release is finalized. This will fix issues MinGW 5.3.0-2 has with compiling with the C++11 standard (-std=c++11).
EDIT 09/03/2016
There are a few updates for the binaries. The first release of Allegro 5.2.1.1 had a few timing issues, which are fixed in the latest release in this thread. It also lacked the static FLAC libraries, which are built and included now. As well, the first distribution of MinGW 5.3.0-2 had a bug in mingw/include/math.h where _hypot was incorrectly referenced, so if you included cmath or math.h when using the C++11 standard, programs no longer compiled. See README_MinGW.txt for details. This will be fixed in an upcoming release. This post has been updated to reflect the new versions of the Allegro binaries and downloads. Please update if necessary. Thanks.
Original Post
Hi everybody.
I've put together some unofficial distributions of MinGW 4.8.1 and MinGW 5.3.0, as well as binaries of Allegro 4.4.3 from GIT as of 8/12/2016 and Allegro 5.2.1.1 for each version of MinGW. Each includes all the example and test programs as well as the addons and dependencies. Only monolith versions of Allegro 5 are provided.
Hopefully this helps get some more people developing with allegro. Development is as easy as using 7-zip to unpack each archive twice and then setting your system path for mingw and your search paths for allegro.
Any questions, ask away.
Get MinGW here
Unofficial distribution of MinGW gcc 4.8.1-4
Unofficial distribution of MinGW GCC 5.3.0-2 v3
Get your classic Allegro 4.4 here
Unofficial distribution of Allegro 4.4.3 for MinGW gcc 4.8.1-4
Unofficial distribution of Allegro 4.4.3 for MinGW gcc 5.3.0-2
And get the modern day Allegro 5.2 here
Allegro5211_MinGW4814_Rel3.tar.7z
Allegro5211_MinGW5302_Rel3.tar.7z
Each Allegro binary comes with a .bat file in the root directory of the archive. If you run it, it sets up a cmd.exe environment ready to run the included examples and test programs. Note, I put the dlls in their own directory to prevent duplication of files, so if you want to run them from without the .bat environment you need to copy the dlls to the appropriate folder. Every program is built as dynamic debug, so you can help debug allegro if something goes wrong on your system.
Please test them out and let me know if everything works as expected. (Examples run, programs using the libs build and run correctly, all headers are included, etc...).
Additionally, included are chm docs for each version of Allegro. I find them much easier to use. I will include them for download separately here in case you just want a nice copy of the manuals :
The scripts I used to build chm docs for Allegro 5 were provided by ArekXV :
I've made a batch script which automatically generates necessary files and compiles CHM file.
All you need to do is to put the contents into docs/html of allegro source run generateCHM.bat and press Enter to begin.
Get it here:
https://www.dropbox.com/s/93queu1a4nvv4wc/generateCHM.7z
Please note that HTML Help Workshop needs to be installed for this to work. This script will look for it in Program Files directory.
I've uploaded a copy since dropbox doesn't work for me. (Anybody else have the same problem?)
Thanks for these... and yes, I will check my paths carefully!
I'm really interested in putting MinGW 5.3.0 on. The only reason I ever use 4.8.1 is for Allegro. So, nice to be able to upgrade that.
Great! I'm glad someone will be putting them to use.
My distro of MinGW gcc 5.3.0-2 comes with gdb and grep included. They're by far the handiest tools I have found for working with code.
I managed to recompile just fine using MinGW 5.3.0-2, and the new Allegro 5. When I ran my game (Deluxe Pacman 2), when it loads a level and waits for a keypress to begin play, the pacman character jumps ahead quite far, then resumes normal play. If I wait long enough, the ghosts will suddenly appear next to you and you die right away.
This appears to have something to do with the timer interrupts. I use three of them. One for redrawing, and two for timing the ghosts and the player.
I didn't reprogram anything, I just recompiled using the new files you supplied.
Here's some code I use where my game waits for a keypress...
//Stop the timers while we wait for a keypress al_stop_timer(pacman.timer); al_stop_timer(ghost[0].timer); al_stop_timer(setting.redraw_timer); // wait for keypress and if it returns true (ESC pressed), exit game loop. bool break_loop = false; if(wait_for_keypress(0)) break_loop = true; //Restart timers al_start_timer(setting.redraw_timer); al_start_timer(ghost[0].timer); al_start_timer(pacman.timer);
So as you can see, this should stop the timers, but I suspect it is not.
This worked for the previous versions. (Edit: that is, it worked with 5.2.0, which was the last I compiled it with, I missed 5.2.1)
EDIT: I ran "ex_timer" and it runs fine. But when I run "ex_timer_pause" from the command prompt, it returns to the prompt right away without anything.
Edit 2: I just noticed that 5.2.1 changed something with the timers, so I assume this is when the problem was introduced? I didn't use 5.2.1 at all, I haven't been on here in a while.
I can confirm the behavior with ex_timer_pause. It exits immediately. If I run it through gdb, it pauses normally. BUT, in neither case do any of the printf statements get output. stdout seems to have been redirected, or else there is something else going on.
It does the same thing for Allegro 5.2.1.1 whether it was compiled with MinGW 4.8.1 or 5.3.0.
You should report this in the Allegro 5.2.1.1 release thread.
EDIT
Neil, I discussed this on the [AD] mailing list and Trent provided a patch he thinks will fix this. Can you download this patched dll and try it with your Pacman game? It needs to be linked to the debugging allegro monolith library I provided for MinGW 5.3.0-2.
EDIT2 (There's a newer version below)allegro_monolith-debug-5.2.dll
Put it in the same directory as your executable so it is the first one loaded (in case you are running the path script I provided).
Edgar, thank a lot for the CHM for latest 5.2.1.1, while I like the manual provided on the main site, *.chm files have always being my favorite way to read documentation as well.
@Rodolfo
You're welcome. It's so nice to have the fixed navigation bar on the left so you can jump between topics with ease. That's why I like CHM so much.
I would prefer it though, if the A5.2 manual was like the A4.4 manual, where the sub topics were included in books on the left. I'm not sure how to achieve that with the current system.
EDIT
@Neil
Trent gave me a second patch. Here is the dll after the second patch (try this one, and ignore the first) :
allegro_monolith-debug-5.2.dll
EDIT2
Neil, where'd ya go???
If anybody else has a game where they start and stop the timers, I'd appreciate it if you could test out the MinGW 5.3.0 Allegro 5.2.1.1 distro with the attached debug dll.
Sorry, haven't been on in a while. I don't use DLLs, I statically link.
Maybe I'll try recompiling with DLLs just to test.
Edit: Sorry, my project it set up for static link compile. When I try compiling for a DLL I get errors.
Okay, here is a patched static debug lib for you to link against. Try linking against this and see if your error timing problem goes away.
liballegro_monolith-debug-static.a
EDITScratch that, use this one instead - the one above has a dependency on the FLAC dll. I didn't notice there was no static FLAC library, and I had to fiddle with it a little bit. What I said makes no sense. A static library has no dependencies. The static FLAC lib is missing from my distribution though, and I'll repackage that tomorrow.
Okay, that one fixed the problem, thanks. Just need a non-debug version.
Maybe I'll get energetic tomorrow and see if I can compile for DLL tomorrow and let you know how that goes.
Perfect. I'll let Trent know the fix is good, and I'll recompile everything tomorrow and make a new release.
Perfect. I'll let Trent know the fix is good, and I'll recompile everything tomorrow and make a new release.
Thanks a lot for your (and Trent's) work. It's appreciated.
I'll try and check back here more often in the future.
Here are patched versions of the Allegro binaries. In addition to fixing the timing issues in 5.2.1.1, static versions of libFLAC are now included as well.
Allegro5211_MinGW4814_Rel2.tar.7z
Allegro5211_MinGW5302_Rel2.tar.7z
If you have any issues, please let me know and post them here.
Thanks!
Edgar
Thanks a lot for that. I recompiled the game with this version of Allegro and MinGW 5.3.0. It's available for download at the link in my signature.
Nice polished game Neil. Tell me, are the levels random? Or just the background?
EDIT
Also, what did you use for the installer? It works quite nicely.
I use Inno Setup, is free software (source is available as well) from http://www.jrsoftware.org/isdl.php
It's simple to use I think.
As for my levels, the game comes with a level editor. It loads the levels in order from the "pak" file (which is just a ZIP file renamed, you can open it as a zip if you like). The game scans for custom levels at start up (there can also be custom images which are displayed before each level, which was something someone requested).
Each level can use whatever background you wish, that is set in the level editor actually. It's just a single tile you change with the mouse wheel (it's all in the manual which nobody reads, ). You draw the lines in the levels, just select a line set, click and drag to draw. I tried to make it as simple as possible to use. The Validate command checks the level for any errors. When a person validates the level, the editor stores a flag showing it was checked, otherwise the level will not load.
The inno setup file for my Deluxe Pacman 2 game is the following, if you want an idea how to do it...
; -- Deluxe Pacman 2.iss -- ; A simple script for now, I will expand on it later. [Setup] UsePreviousAppDir=no ;changed the next two from yes to no DisableStartupPrompt=no DisableDirPage=no AppName=Deluxe Pacman 2 AppVerName=Deluxe Pacman 2 version v16.09.03 (1745) AppVersion=v16.09.03 (1745) OutputBaseFilename=Deluxe_Pacman_2_setup OutputDir=Setup DefaultDirName={%userprofile}\Deluxe Pacman 2 DefaultGroupName=Deluxe Pacman 2 SetupIconFile=Deluxe_Pacman_2.ico [Files] Source: "bin\Deluxe Pacman 2.exe"; DestDir: "{app}" Source: "bin\Pace 2.exe"; DestDir: "{app}" Source: "bin\Deluxe Pacman 2.pak"; DestDir: "{app}" Source: "bin\Line Example.png"; DestDir: "{app}" Source: "docs\Deluxe Pacman 2 - License.txt"; DestDir: "{app}\docs"; Flags: isreadme Source: "docs\Deluxe Pacman 2 - Manual (Read this!).txt"; DestDir: "{app}\docs" Source: "docs\Deluxe Pacman 2 - Journal.txt"; DestDir: "{app}\docs" Source: "docs\Deluxe Pacman 2 - Cheat Keys.txt"; DestDir: "{app}\docs" [Icons] Name: "{group}\Deluxe Pacman 2"; Filename: "{app}\Deluxe Pacman 2.exe"; WorkingDir: "{app}" Name: "{group}\Level Editor"; Filename: "{app}\Pace 2.exe"; WorkingDir: "{app}" Name: "{group}\Uninstall"; Filename: "{uninstallexe}" Name: "{group}\Documentation\Manual"; Filename: "{app}\docs\Deluxe Pacman 2 - Manual (Read this!).txt" Name: "{group}\Documentation\Journal"; Filename: "{app}\docs\Deluxe Pacman 2 - Journal.txt" Name: "{group}\Documentation\Licence"; Filename: "{app}\docs\Deluxe Pacman 2 - License.txt" Name: "{group}\Deluxe Pacman 2 website"; Filename: "http://home.cogeco.ca/~nroy15/games_index.html" Name: "{userdesktop}\Deluxe Pacman 2"; Filename: "{app}\Deluxe Pacman 2.exe"; WorkingDir: "{app}"
Bump. In case there are any issues reported with the binaries...
EDIT
Forgot to upload the D3D dlls. Here they are in case you want to run ex_d3d or use the D3D driver.
D3D_DLLS.7z
With a new Windows install on my laptop I thought I'd use new versions of the software too. (I was still using 5.0.10 and MinGW 4.7.1-tdm )
Now I have CB13 (zip without compiler) and I followed the wiki page for installation again, except there is no bundle of "static-mt" files this time.
This is the linker portion of my cbp file:
<Linker> <Add option="-s" /> <Add option="-static-libgcc" /> <Add library="C:\Allegro5211_MinGW5302_Rel2\lib\liballegro_monolith-static.a" /> <Add library="C:\MinGW5302\lib\libgdiplus.a" /> <Add library="C:\MinGW5302\lib\libuuid.a" /> <Add library="C:\MinGW5302\lib\libkernel32.a" /> <Add library="C:\MinGW5302\lib\libwinmm.a" /> <Add library="C:\MinGW5302\lib\libpsapi.a" /> <Add library="C:\MinGW5302\lib\libopengl32.a" /> <Add library="C:\MinGW5302\lib\libglu32.a" /> <Add library="C:\MinGW5302\lib\libuser32.a" /> <Add library="C:\MinGW5302\lib\libcomdlg32.a" /> <Add library="C:\MinGW5302\lib\libgdi32.a" /> <Add library="C:\MinGW5302\lib\libshell32.a" /> <Add library="C:\MinGW5302\lib\libole32.a" /> <Add library="C:\MinGW5302\lib\libadvapi32.a" /> <Add library="C:\MinGW5302\lib\libws2_32.a" /> <Add library="C:\MinGW5302\lib\libshlwapi.a" /> </Linker>
Am I doing this right? Should the compiled program ask for libstdc++-6.dll and libgcc_s_dw2-1.dll? When I put those in the same dir it runs OK.
Or should I link a different Allegro library?
If you're linking liballegro_monolith-static.a and it is asking you for libstdc++-6.dll and libgcc_s_dw2-1.dll then I built it wrong. I just need to go back and add -static to the compile options in cmake.
Gimme a little bit and I'll re-build and re-upload. Thanks for pointing that out.
Here are the new versions of the static allegro monolithic libraries for each compiler :
Allegro5211_MinGW4814_Rel3_StaticLibs.7z
Allegro5211_MinGW5302_Rel3_StaticLibs.7z
I'll update the distros a little later when I have time to upload them.
Note - GCC 4.8 and 5.3 both link to the c and c++ standard libraries dynamically, so you have to use "-static -static-libstdc++ -static-libgcc" in your compile line to static link those libs against your exe, otherwise you'll need to include those dlls with your program.
OK, thanks. Two questions, has the resulting exe grown so much because I link the monolith version?
And how did
<Add option="-s" />
get into the cbp file and what does it do?
(I mean I also have
<Add option="-DALLEGRO_STATICLINK" />
there but I know how I got it)
A static version will have a larger executable, but you end up saving space in the long run by not having to distribute dlls containing every function (used or not).
-s strips the executable of all symbols, resulting in a smaller file. Don't do this if you want to debug and you are using -g otherwise your debugging information will be stripped.
Here's the complete CodeBlocks project file I have for my Deluxe Pacman 2, compiled with Edgar's Allegro 5 setup and CodeBlocks 16.01 (the latest). It may help you with yours (it should work with CodeBlocks 13, I was using it with 13 up until recently).
This is my complete project file with debug and release version setup in it.
note: I compile with C11 code. Not C++. Otherwise, this works well for me. I have CodeBlocks in "C:\develop\CodeBlocks", I have MinGW by itself in "C:\MinGW" and I have separate libraries I add on (like Allegro) in "C:\MinGW_Dev_Lib\". This way I can easily update MinGW without effecting my add on libraries.
I've uploaded new binary distributions of Allegro 5.2.1.1. See the latest edit in the OP for details. They now include the D3D dlls, link statically to the CRT, and include a full list of libraries to link when linking statically.
Please update your packages accordingly.
Awesome, thanks again Edgar!
I look forward to using the binaries and thanks for the cbp file guys but this
7za e Allegro5211_MinGW5302_Rel3.tar.7z
gives
Extracting Allegro5211_MinGW5302_Rel3.tar Unsupported Method
Using x does not help, l for list contents works. The compression method used varies, right? Sometimes WinRAR can extract but usually not. And 7za has never failed yet. What can I do?
7z.exe is the command line version of 7-Zip. 7z.exe uses 7z.dll from the 7-Zip package. 7z.dll is used by the 7-Zip File Manager also.
7za.exe (a = alone) is a standalone version of 7-Zip. 7za.exe supports only 7z, lzma, cab, zip, gzip, bzip2, Z and tar formats. 7za.exe doesn't use external modules.
It looks like 7za may not support it, even though it says it supports .7z and .tar formats.
Use the installer and use the right click context menu or set the path to 7-zip and use 7z.exe instead.
I tried extracting using "7z x Allegro5211_MinGW5302_Rel3.tar.7z -oTest\" and it worked fine to extract it to the test directory.
People who don't like to install go here: http://www.7-zip.org/download.html
and download "7-Zip Extra" it has the (or a?) 7za.dll too and it extracts the tar.
Apparently the compression method I used on the tar file to create the 7z file was LZMA2. 7za doesn't support LZMA2.
So either install the regular tools, which I personally think are awesome. Or wait for me to upload a version with LZMA compression.
Actually, nevermind. I tested with 7za 9.2 and it worked just fine. Try updating to the latest (old) version.
To be clear: it is the 16.02 version that I downloaded, I was trying to tell that it works (7za.dll and 7za.exe to windows/system32).
You're right, WinRAR 3.51 does not support LZMA2 either.
I've uploaded a new version of MinGW 5.3.0-2 that fixes several issues compiling with the C++11 standard. mingwrt 3.22 and win32api 3.18 are included with the new version.
Get it here :
https://sourceforge.net/projects/unofficialmingw/files/MinGW5302v2.tar.7z/download
Thanks for that again Edgar.
As for opening the .7z files, I installed 7zip, then just double click the .7z file, you see the .tar inside of it, double click that, it opens up. No command lines, nothing. Drag and drop after that. Doesn't get any easier.
There are some additional bugs with compiling Allegro programs as C++11 that are getting fixed as we speak. As soon as mingwrt3.22.4 comes out I will update the compiler again.
Keith Marshall has addressed a patch to fix these issues. You can get the updated wchar.h or the patch for 3.22.3 below. I will update the MinGW distro when I have time.
Just patch mingw/include/wchar.h with the patch, or overwrite with the new version to fix the problems mentioned here :
https://www.allegro.cc/forums/thread/616526/1025473#target
EDIT 10-29-2016
I've updated MinGW 5.3.0-2 to use mingwrt3.22.4 to fix several issues when compiling with the C++11 standard.
Get it here : MinGW5302v3.tar.7z
Thanks. You do know that when compiling C the off_t errors occurred as well? The "-std-c99" had to be taken out for C. I'll use this tonight.
I had to log in just to salute Edgar for all his efforts.
Thanks. You do know that when compiling C the off_t errors occurred as well? The "-std-c99" had to be taken out for C. I'll use this tonight.
The off_t errors had to do with __STRICT_ANSI__ being defined, which happens with C++11 or with C99, I believe.
I had to log in just to salute Edgar for all his efforts.
Thanks! Lurk less and post more!!!
Hell yeah, nice work Edgar !