Skip to main content
GameDev.net gamedev.net
🔒 Locked

Allegro installation?

Started by ZeroRadius Sep 22, 2012 at 10:31 PM 13 replies 17.1k views
Original Post
ZeroRadius
ZeroRadius
Hey guys and gals,

I am new to game programming (actually any type of desktop programming, I usually do web development with LAMP/WAMP). I am trying to start learning game development using C++. I found a few good tutorial series and they all use Allegro game library. I have never used a library in this type of environment before and I am having some problems. First I was going to try to use Visual C++ 2008 but every mention I found on allegro said to download it from allegro5.org , I can not however find a place to download it from that site, nor can I find another place to download it (at least not one that my antivirus did not flag on download)

So next I installed Code Blocks 10.5 and followed the following instructions to try and install Allegro: http://wiki.allegro....le=Code::Blocks

I am having some problems with it thou. When I run these comands:

> FIX.BAT mingw
> MINGW32-MAKE.EXE
> MINGW32-MAKE.EXE DEBUGMODE=1
> MINGW32-MAKE.EXE install
> MINGW32-MAKE.EXE install DEBUGMODE=1
[/quote]

I can run >fix.bat mingw
everything else seems to fail (or maybe i don't know what success looks like? Check the attachment to see what I got when I ran these commands.

Can someone help me please? I would prefer to use MSVC 2008 sense I eventually want to make win 8 metro games using MSVS 2012 but when it comes down to it, right now I am just trying to learn, I do not care what IDE I use as long as I can get Allegro working. I am about to head off for the graveyard shift but I am off tomorrow and hopefully can make some headway with this


Thanks in advanced
~ Zero

P.S : If this is in the wrong section I apologies, it just seemed like a beginner question
Liuqahs15
Liuqahs15
If you don't care the IDE, getting it running in Visual Studio 2010 is easy. Same with 2012.

1. Download it: http://alleg.sourceforge.net/download.html

2. Save it to the c: drive

3. Follow these steps: http://wiki.allegro.cc/index.php?title=Windows,_Visual_Studio_2010_and_Allegro_5

4. Here's a video walkthrough/tutorial series, from installation to setup to coding your first game: http://fixbyproximity.com/2d-game-development-course/

5. Have fun
LennyLen
LennyLen
ZeroRadius: You are following a guide for installing Allegro 4, not Allegro 5. The easiest solution is to just follow the guide that Shaquil linked to. If you are still having difficulties, the best place to get help for Allegro is at Allegro.cc
ZeroRadius
ZeroRadius
Ok thanks guys. It did not work for me. I downloaded express 2010 and followed all the instructions. Re-checked everything about 8 times and it still gives me a fail when I try to build it. Can you look at the screens (attached) and make sure I did everything right? If I did I will go to the allegro.cc and try to get help there.

Thanks in advance.

Note: One set of screens shows the information I put into the Debug Config, one is the information i put in the release config, and the third set is the zip of the file i downloade (so you can see the version) and the directory that I have it in.
Programming020195BRook
Programming020195BRook
Can you please post the fail message?

If you created an empty project and made a main.cpp which has:


[source]#include
#include

int main(int argc, char **argv)
{
ALLEGRO_DISPLAY *display = NULL;

if(!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}

display = al_create_display(640, 480);
if(!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}

al_clear_to_color(al_map_rgb(0,0,0));

al_flip_display();

al_rest(10.0);

al_destroy_display(display);

return 0;
}[/source]


Everything should work, but please post your error message along with the full directories for your allegro include and lib folder.
ZeroRadius
ZeroRadius
Of course, Sorry that I forgot to include it to begin with.


1>------ Build started: Project: AllegroTest2010, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\zeroradius\documents\visual studio 2010\projects\allegrotest2010\allegrotest2010\main.cpp(2): error C2059: syntax error : '?'
1>c:\users\zeroradius\documents\visual studio 2010\projects\allegrotest2010\allegrotest2010\main.cpp(32): fatal error C1083: Cannot open include file: 'allegro.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/quote]


Edit:

C:\allegro\lib
C:\allegro\include

(I assume that is what you meant by full directories?)
ZeroRadius
ZeroRadius
Ok sorry, I'm going to re-post , that was the wrong error message from where i was trying various things earlier.
Heres the actual error message:

1>------ Build started: Project: AllegroTest2010, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\zeroradius\documents\visual studio 2010\projects\allegrotest2010\allegrotest2010\main.cpp(2): fatal error C1083: Cannot open include file: 'allegro5/allegro.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/quote]

heres the source:
[source]#include
#include

int main(int argc, char **argv)
{
ALLEGRO_DISPLAY *display = NULL;

if(!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}

display = al_create_display(640, 480);
if(!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}

al_clear_to_color(al_map_rgb(0,0,0));

al_flip_display();

al_rest(10.0);

al_destroy_display(display);

return 0;
}[/source]

dirs:
C:\allegro\lib
C:\allegro\include
ZeroRadius
ZeroRadius
same thing:


1>------ Build started: Project: AllegroTest2010, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\zeroradius\documents\visual studio 2010\projects\allegrotest2010\allegrotest2010\main.cpp(2): fatal error C1083: Cannot open include file: 'allegro.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/quote]
Programming020195BRook
Programming020195BRook
Okay this is the problem, it cannot find allegro.h !

For example, I use: #include because I have my C/C++ General Include set to ->>>> C:\allegro-5.0.5\include

If you go into your include folder, you should see another folder which has your allegro.h file, mine happens to be allegro5.

I just downloaded the 5.0.7 version to check the folder, and it shows the file in allegro5.

Using: #include should work! So you must have set your direct wrong in your settings.

Type your directory address for the file instead. Should show this:
#include "C:\allegro-5.0.5\include\allegro5\allegro.h" (SOMETHING LIKE THIS) and remove: #include
ZeroRadius
ZeroRadius
OMG you are awsome!

That worked ....on the first error. I have another error:


1>------ Build started: Project: AllegroTest2010, Configuration: Debug Win32 ------
1> main.cpp
1>c:\allegro\include\allegro5\allegro.h(26): fatal error C1083: Cannot open include file: 'allegro5/base.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/quote]

even thou I knew it would not work I tried to use an include directive for it ....... obviously it did not work.I am going to try googling it, but if anyone knows how to fix it I would appreciate you telling me.

@Black-Rook - Does this website have rep/karma if so how do i give it to you (or is that what the little arrows under your avatar is for?) Thank you so much, I'm glad to make progress on this, I was about to give up.
Programming020195BRook
Programming020195BRook
Okay what appears to have happened is that you've set your directories incorrectly. Just encase you didn't know, you must also reset your directory for each new project you create in your project settings. I would strongly suggest you make a project already setup with a generic main.cpp file, and just copy and past the whole project so you don't have to setup everything again. However, if you use a new version you will have to redo everything.
ZeroRadius
ZeroRadius
ok, I think I got it. I am no longer getting those errors. I am instead getting


1>------ Build started: Project: test1Console, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/quote]

After a little googling it looks like I have to uninstall my vs 2010 and 2012 along with frameworks 4.0 and 4.5 and then re-install vs 2010 ..... the point is the code that is calling allegro is no longer underlined in red and no longer throwing an error (unless this new error for console apps is just taking precedence). Any way it looks like it will be work for my next day off. This issue was solved. Thanks everyone. Black-rook your a life saver


Edit: Actually I only had to install SP1 for VS 2010 and now it is working!!! I finally get to start my adventure in game programming! Thank you!!!
Programming020195BRook
Programming020195BRook
Yes, the 4.5 framework causes issues sadly. You can try the following though:

Set Generate Manifest to No, or you can disable incremental Linking. Under Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)".

Hope this helps!

Edit: Yes, SP1 is also an option, sorry I forgot all about it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.