Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Allegro installation?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 22 September 2012 - 04:31 PM

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


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

Attached Thumbnails

  • allegroWoes.JPG

Edited by ZeroRadius, 22 September 2012 - 04:33 PM.


Sponsor:

#2 Shaquil   Members   -  Reputation: 819

Like
2Likes
Like

Posted 22 September 2012 - 05:21 PM

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

#3 LennyLen   Crossbones+   -  Reputation: 3875

Like
2Likes
Like

Posted 23 September 2012 - 07:04 AM

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

#4 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 23 September 2012 - 09:20 PM

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.

Attached Thumbnails

  • release.jpg
  • debug.jpg
  • files.jpg


#5 Black-Rook   Members   -  Reputation: 1563

Like
1Likes
Like

Posted 24 September 2012 - 02:05 AM

Can you please post the fail message?

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


#include <stdio.h>

#include <allegro.h>



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;

}



Everything should work, but please post your error message along with the full directories for your allegro include and lib folder.
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#6 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 24 September 2012 - 02:16 AM

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 ==========



Edit:

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

(I assume that is what you meant by full directories?)

Edited by ZeroRadius, 24 September 2012 - 02:18 AM.


#7 Black-Rook   Members   -  Reputation: 1563

Like
1Likes
Like

Posted 24 September 2012 - 02:22 AM

Please copy your main.cpp code.

If you're using the cpp tag option it might not show anything after #include <wont show> for some reason.... You can edit your post and just take the cpp part off, and keep it as source.

Edited by Black-Rook, 24 September 2012 - 02:24 AM.

GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#8 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 24 September 2012 - 02:29 AM

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 ==========


heres the source:
#include <stdio.h>
#include <allegro5/allegro.h>

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;
}


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

Edited by ZeroRadius, 24 September 2012 - 02:30 AM.


#9 Black-Rook   Members   -  Reputation: 1563

Like
1Likes
Like

Posted 24 September 2012 - 02:32 AM

Try removing: #include <allegro5/allegro.h> and using: #include <allegro.h>
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#10 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 24 September 2012 - 02:34 AM

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 ==========



#11 Black-Rook   Members   -  Reputation: 1563

Like
1Likes
Like

Posted 24 September 2012 - 02:45 AM

Okay this is the problem, it cannot find allegro.h !

For example, I use: #include <allegro5/allegro.h> 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 <allegro5/allegro.h> 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 <allegro5/allegro.h>
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#12 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 24 September 2012 - 02:58 AM

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 ==========


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.

#13 Black-Rook   Members   -  Reputation: 1563

Like
1Likes
Like

Posted 24 September 2012 - 03:07 AM

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.
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#14 ZeroRadius   Members   -  Reputation: 141

Like
0Likes
Like

Posted 24 September 2012 - 04:34 AM

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 ==========


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!!!

Edited by ZeroRadius, 24 September 2012 - 04:53 AM.


#15 Black-Rook   Members   -  Reputation: 1563

Like
1Likes
Like

Posted 24 September 2012 - 04:52 AM

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.

Edited by Black-Rook, 24 September 2012 - 05:03 AM.

GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS