wsystem.c fails to build with an error about conflicting types for the DllMain function. wsystem.c defines one, and so does winbase.h. I don't know which is correct so I don't know how to patch this. Anyone know?
c:\mingw\LIBS\Alleg44X_git\allegro\build>mingw32-make install [ 1%] Building C object CMakeFiles/allegro.dir/src/win/wsystem.c.obj C:\mingw\LIBS\Alleg44X_git\allegro\src\win\wsystem.c:35:15: error: conflicting types for 'DllMain' BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason, LPVOID lpReserved) ^ In file included from C:/mingw/include/windows.h:62:0, from C:/mingw/LIBS/Alleg44X_git/allegro/include/winalleg.h:54, from C:/mingw/LIBS/Alleg44X_git/allegro/include/allegro/platform/aintwin.h:31, from C:\mingw\LIBS\Alleg44X_git\allegro\src\win\wsystem.c:27: C:/mingw/include/winbase.h:1051:13: note: previous declaration of 'DllMain' was here BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID); ^ CMakeFiles\allegro.dir\build.make:3072: recipe for target 'CMakeFiles/allegro.dir/src/win/wsystem.c.obj' failed mingw32-make[2]: *** [CMakeFiles/allegro.dir/src/win/wsystem.c.obj] Error 1 CMakeFiles\Makefile2:62: recipe for target 'CMakeFiles/allegro.dir/all' failed mingw32-make[1]: *** [CMakeFiles/allegro.dir/all] Error 2 Makefile:105: recipe for target 'all' failed mingw32-make: *** [all] Error 2 c:\mingw\LIBS\Alleg44X_git\allegro\build>
Also, here is a patch to enable building of the addons as shared libraries :
The comment about DLL main says that it's necessary for DMC. I and most people couldn't care less what builds on DMC, so could you just test if removing it fixes the issue for you? Make sure it all still links and runs etc. Specifically, try the attached patch.
Removing it is a good test, but if its dead simple to keep the compatibility, say an ifdef DMC or just make the decl the same as windows's then it would be best to do that. imo.
Yeah, I added the patch that does that.
Everything builds with the patch, static or dynamic, but I'm getting a bunch of weird errors - "Warning: corrupt .drectve at end of def file". It appears 4 times in a row for each executable linked. A static release build did that anyway, maybe others too.
That's a bit worrying, but I think it might be an issue with your MinGW setup (judging by my quick searches on the internets). I'll look into on my MinGW and see if I get this. Never thought I'd be compiling Allegro 4 on Windows in 2015 .
I'm sure it's probably something I did or have left over somewhere that is doing it. It's troubling there is no uninstall target, or is there? I can't remember. Because I don't want an already pre-installed version of allegro to interfere with the compilation of the newer version (already hit that one once).
::sigh:: I can't seem to manage to build it. For whatever reason dat.exe is not linking (the linking order is wrong).
Actually... the reason it's not building is because of the shared addons... can you verify that it actually builds with SHARED=on with a clean build directory?
Latest git with a clean build compiles and links fine. No probs with dat.exe or anything else. All shared addon libraries built successfully. MinGW 4.8.1, Vista