- Online Community
Post Reply Forums » Installation, Setup & Configuration » [A4]How to cross-compile allegro on mingw for Gitlab CI

rss feed Print
[A4]How to cross-compile allegro on mingw for Gitlab CI
Member #3,185
January 2003

So far, I have successfully cross-compiled on linux a windows program using mingw64 if only using the basic libc libraries. I also managed to configure a remote CI cross-compilation on gitlab and it worked.

Now, If I try to do the same with a program that needs the allegro library, it fails as it cannot find any of the libs and includes. That is normal since Mingw use it's own set of lib and includes instead of those installed on the system.

So I guess, I'll have to re-build Allegro library specifically for mingw 32bit and 64 bit compiler. So the questions are:

  • How can I build my own lib for mingw on my local machine?

  • Is there some pre-compiled binaries I can use instead of building it? Is there some artifacts somewhere I can just download?

  • Is there a way to shorten the build process? (For example, not building the tools, examples, etc) Since it could consume too much CI time if I have to rebuild allegro after each commit.

Enjoy! and have fun

Member #5,749
April 2005

It's been a looong time since I've touched A4, but I can give you some pointers re CI and cross-compiling.

To get build times down, you'll probably want to bring your own Docker image with mingw64 pre-installed. I dug out one I used ages ago for cross-compiling with A5, which is as follows:

FROM ubuntu:20.04

RUN apt-get update
RUN apt-get install -y p7zip-full mingw-w64
RUN mkdir /allegro-w64
RUN curl -L > /allegro-w64/
RUN curl -L > /allegro-w64/
RUN cd /allegro-w64 && 7z x && 7z x && \
  cp -r /allegro-w64/allegro/bin/*          /usr/x86_64-w64-mingw32/bin/     && \
  cp -r /allegro-w64/allegro/include/*      /usr/x86_64-w64-mingw32/include/ && \
  cp -r /allegro-w64/allegro/lib/*          /usr/x86_64-w64-mingw32/lib/     && \
  cp -r /allegro-w64/allegro_deps/include/* /usr/x86_64-w64-mingw32/include/ && \
  cp -r /allegro-w64/allegro_deps/lib/*     /usr/x86_64-w64-mingw32/lib/     && \
  rm -rf /allegro-w64

I'm using A5's precompiled mingw libs here. I believe some have ventured into binary distributions for A4 (Edgar?) but you can find precompiled stuff for some (slightly older) 4.4 releases right here on If none of that works, you'll probably want to run the mingw compilation itself inside of the Dockerfile, which I won't go into unless you absolutely need it :P

Also worth noting is that once you've built your CI image, you can host it on GitLab itself.

Website. It was
This isn't a game!

Member #940
January 2001

If you're using a CI system, you might like my prepared docker images:

Now I've prepared an allegro4 image for linux, and an allegro5 image for mingw and linux. What I don't have yet is an allegro4 image for mingw...

Edgar Reynaldo
Major Reynaldo
May 2007

dthompson said:

I believe some have ventured into binary distributions for A4 (Edgar?) but you can find precompiled stuff for some (slightly older) 4.4 releases right here on

The binaries on are a decade old by now.

I have a more modern version on bitbucket here :

You would need the appropriate mingw-w64 from sourceforge to use it though.

I may also be inspired to make up to date versions if you really need them. It isn't too hard.

Member #3,185
January 2003

I'll give it a try later when I have more time. I need to wrap things up for my release. Seems that a lot of other CI stuff is also ot working as intended.

Old binaries could be fine since A4 is old. As long as it is compatible with the binaries I am trying to build with Mingw64.

I have not much experience with Docker, besides that the Gitlab CI system use a docker image to build my software.

Enjoy! and have fun

Post Reply
Go to: