how cannot compile allegro using visual c++



I just downloaded the allegro library

I make a new empty project then add a source file

I add this line of code:

#include <allegro.h>

I compile and get the following error:

c:allegroincludeallegro5internalalconfig.h(28) : fatal error C1083: Cannot open include file: ‘allegro5/platform/alplatf.h’: No such file or directory

so I go into alconfig.h and change:

#include "allegro5/platform/alplatf.h"


#include "../../allegro5/platform/alplatf.h.cmake"

it now gives me this error:

c:allegroincludeallegro5platformalplatf.h.cmake(2) : fatal error C1021: invalid preprocessor command ‘cmakedefine’

so I get rid of the #include "../../allegro5/platform/alplatf.h.cmake" statement it then says:

c:allegroincludeallegro5internalalconfig.h(57) : fatal error C1189: #error : platform not supported

I do not know were to go from there, I am running windows so I really am stumped





It looks like you are trying to use the source version without even building it. Please see the included instructions for information on how to build it. In short, you need to install cmake and do the following:

  • open the Visual Studio command prompt
  • cd c:allegro
  • mkdir build
  • cd build
  • cmake ..
  • nmake

At that point, Allegro should be built. You could also create MSVC project files instead by supplying the appropriate option to cmake -G "Visual Studio ...". Then you could build Allegro from within Visual Studio. (Although running nmake is probably faster and less hassle.)

You must have all the dependencies if you want to build anything but a generic installation. I’d highly recommend that you just download a prebuilt binary for Windows from:

and ignore all of the above about how to build it yourself.


Facebook Comments

Post a comment