Installing the Allegro Library
The programs in this chapter require graphical output. You won't be able to run them online,
you need to have an C++ development system installed.
This tutorial assumes you have a C++ development system already installed. If not, the recommended IDE is Visual Studio 2017 (or 2015 or 2013), which you can install following these installation instructions. Instructions for Linux-based operating systems will also be provided.
You can find more information about the Allegro library on:
We will be using Allegro library version 4.4. Allegro version 5 is substantially different, and cannot be used as a substitute for Allegro version 4.
Download Allegro Library
For Microsoft Visual Studio 2015/2013, you can download the Allegro library from:cdn.allegro.cc/file/library/allegro/4.4.2/allegro-4.4.2-msvc-10.0.zip/
If you are working on Linux and prefer to compile your programs from the command line, just install development version of the Allegro 4 library from your default repository. In the repository, it could be named
liballegro4-dev. Here are the instructions for compiling a program from the command line.
Alternatively, select Windows Binaries for MSVC 10 fromwww.allegro.cc/files/?v=4.4
A zip file
containing the entire Allegro library will be downloaded; this zip file needs to be unpacked first. It would be simplest to unpack it into the
C:\allegro folder, but you can choose
another folder if you like.
Unpack and Install Allegro Library
First, you need to create a folder to contain files making up the Allegro library. Use the
Windows Explorer or your preferred method to
create the folder
On Microsoft Windows OSes, the file our future programs will need to find upon execution is named
When a program runs, it will search for this file in the
c:\windows\system32 directory. Before that, it will search the directory from which the program was run. Visual Studio runs programs from the directory of their project (where the mentioned
.dll file should be put if it is not placed in the
windows\system32 directory). Similarly, if the program's executable file is run manually from its directory, the said
.dll file should be in the same folder where the program's executable file is located.
Then, you should use the Windows Explorer
or your other favorite method to unpack the contents of the zip file containing the Allegro library into the folder
The zip file should contain
Copy there to the folder
c:\allegro using Windows Explorer
or your preferred method.
When the unpacking process completes, the
Allegro library dynamic link (
.dll) files need to be made available to all programs on
the system. To do that, copy the entire contents of
c:\allegro\bin directory into the
c:\windows\system32 directory. You
will need administrator privileges to do that.