This post is a portion of Part 1 in my on going series about 2D Game Development using the Allegro 5 library. These posts are in course order. You can see all of the posts in this course by clicking the “2D Game Development” button at the top of this site.
- Part 1.0: Intro to Game Development
- Part 1.1: Installing Allegro 5 with Visual Studio 2010
- Part 1.2: Your First Allegro 5 program
In this video, we are looking at testing the installation we did in the previous section. I walk you through a simple application to compile and make sure everything is working.
In Part 2 we will be looking at getting into the world of 2D games.
Full source can be downloaded here.

Hi mate,
After doing all of the above following steps, and double checking that I have installed it correctly I am still getting the error after the end of this tutorial
–
1>—— Build started: Project: Alegro Test, Configuration: Debug Win32 ——
1> main.cpp
1>c:userssoxdocumentsvisual studio 2010projectsalegro testalegro testmain.cpp(1): fatal error C1083: Cannot open include file: ‘allego5allegro.h’: No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any suggestions?
The line should be allegro5allegro.h
You are missing an ‘r’
Hope this helps.
Well, I tried making this under Code::Blocks after following a long and tiring configuration tutorial on their site, but it fails to compile.
It says that I’m giving too many arguments to the “al_show_native_message_box” function.
Also, I observed that you got this neat feature: when you type an include, or a function, some auto-complete pops up showing similar named functions. Is this only a Microsoft Visual Studio specific feature, or can I get it to work on Code::Blocks too? Because certain things appear to pop-up in Code::Blocks, but not allegro functions. It would be a great help for a newbie like me.
I should add that I followed the tutorial for “Static” linking, and I am using Allegro 5.0.4 binaries compiled for MinGW 4.5.2.
Here’s the link of their tutorial: http://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_10.05_and_Allegro_5
Let me work on that and get back to you.
Try this: http://www.allegro.cc/forums/thread/606041
Well, unfortunately that is one tutorial I’ve followed in the past, but now it’s useless because the 5.0.4 binaries are pre-compiled. There’s no point to struggle with compiling myself the source code.
. This takes away of my enthusiasm
.
The one I followed should work just fine but it doesn’t
Mind posting some of your code? What happens if you remove that command? Does the rest of the program function?
It’s exactly the same code like in your “Your First Allegro 5 Program” tutorial, except that I added all these things “#include
#define ALLEGRO_STATICLINK
#include “allegro5/allegro.h”
#include “allegro5/allegro_font.h”
#include “allegro5/allegro_ttf.h”
#include “allegro5/allegro_image.h”
#include “allegro5/allegro_primitives.h”
#include ”
before the int main.
It warns be that I am converting to non-pointer type ‘int’ from null, and then it says that I give the al_show_native_message_box function too many argments.
Actually it seems that I didn’t see well in your video and copied 7 arguments (I had one more “,NULL” in there) instead of 6.
.
If I try to compile the source file, it goes well.
If I try to hit “Build and Run” an error appears: “undefined reference to ‘PathFindOnPathA@8′. I have no idea what this is
Check this: http://stackoverflow.com/questions/7071769/allegro-compile-error-undefined-reference-to-pathfindonpatha8
Haha, thanks. That solved the problem. Now I can follow your tutorials. Again, it’s late and I will leave that for tomorrow. One question though, for each new Allegro 5 project, do I have to remake the linker configurations?(manually add the libraries each time). Is there an “preset” option or something like that?
Very nice tutorial. Is there any plan for a text format of the tutorial? I like to reading tutorials rather than watching them.
I have no plans at this time to make a text version. I just don’t have the time to do it. If someone else would like to, I would be more than happy to host
Mike, do you know how to apply the same debugging settings to multiple projects? Specifically I want to set the same environment variable in “Configuration Properties -> Debugging” in multiple projects within a solution. Loading/saving Property Sheets from the Property Manager does not seem to affect the Debugging settings, only the General, C/C++, Linker settings etc.
There does not seem to be a way of saving and applying Debugging settings to other projects… Any ideas?
when i run my program it tells me there was build errors
1>—— Build started: Project: allegrotest, Configuration: Debug Win32 ——
1> main.cpp
1>d:\users\hodgen\desktop\c++\allegrotest\allegrotest\main.cpp(21): error C2059: syntax error : ‘)’
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have faith that you can figure this one out. My instincts are telling me something strong about line 21… maybe an extra parenthesis.
for some reason it worked when i copied into another project, there shuold be a black box that pops up for a second right?
Just for convenience, I am following your tut with Allegro 5.0.5, MingW 4.5.2 and Code::Blocks.
I’d like to give a heads-up against keeping all those NULL in the call to al_show_native_message_box agruments…in my trials this prevents ANY text (also the ones we are typing there to inform about initialization problems) to show up, so you get a perfetcly empty dialog box..providing at least Window Title lets the message show up correctly.
I don’t know if thisi s a bug in Allegro call or not but I am about to file a one in Allegro BugTracker.
It could also be nice to pass ALLEGRO_MESSAGEBOX_ERROR as a flags paramenter instead of a NULL pointer, since then you geta “error” kind of dialog instead of the “information” one.
nothing really important but maybe useful to know.
Awesome, thanks for the info
hey, i tryed to run the code in your tutorial but when ever i do it says:
unable to start the program Ç:\users\locky\documents\Visual Studio 2010\Projects\Allegro Test 1\Debug\Allegro Test.exe’.
The system can not find the file specified.
any ideas? i think i may have moved one of the files somewhere and now im not sure what to do.
hey mike i am also getting the same error as Locky here..whenever i compile it says
it cant find the file specified.i double checked the executable location..everything is perfect.but i am getting the same error message..plz help
Where is your project set to place the output? You may want to check that or start a new project and try it.
thanxs mike!!! i rechecked the file location and there was an error..and did two different things…instead of copying include and lib folder into msvc 2010′s respective include and lib folders,,,i copied the address of allegro’s include and lib in my project properties tab under :C\C++->General->Additional include directories and Linker->General->Additional Lirary directories….while Linker->Input->Additional Dependencies is the same i.e.allegro-5.0.6-monolith-md-debug.lib…(i using 5.0.6 version).
i wanna know what i did is just an alternate path or the same thing.?thanxs again for ur great work sir..