Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Install with Dev C++

Credits go to Edgar Reynaldo, LennyLen, and wiseguy for helping out!
This thread is locked; no one can reply to it. rss feed Print
Install with Dev C++
usernamed
Member #9,864
June 2008

Hello everyone. I'm using Dev C++ and I wanted to know how to install allegro for that program. I looked around the Wiki and it seems that there is a different way to install allegro for different compilers, most of which around Visual Studios, but I didn't find anything for Dev C++. Will allegro work with Dev C++? Is there a guide I can use for installing it with Dev C++?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

You can download Allegro's source code and compile the library yourself , you can download a precompiled binary version , or you can download a dev-pak for allegro but I don't know where you would find the dev-pak, what version of Allegro that it would be for or how to install it.

In the allegro source zip file there are build instructions for all the supported platforms under allegro\docs\build. Since you're using dev-c++ you want to read the file mingw32.txt in that directory.

Everything you need is on the Allegro Files page.

LennyLen
Member #5,313
December 2004
avatar

Quote:

or you can download a dev-pak for allegro but I don't know where you would find the dev-pak, what version of Allegro that it would be for or how to install it.

I created a DevPak for Allegro 4.2.2 a while back.

To install it from Dev-C++, go to 'Tools\Check for Updates/Packages.' Change the DevPak server to devpaks.org, then click the 'Check for Updates' button. One they've loaded, select 'Allegro' from the 'Groups:' drop-down menu and clcik on the check-box next to 'Allegro 4.2.2. Now click 'Download Selected.' This will download the DevPak and install it for you.

usernamed
Member #9,864
June 2008

I'm new at this library so I'll first try LennyLen's method. I set the DevPak parameter devpaks.org (on port 8010) and started the download. In the status window, I get these errors.

Any recommendations?

[img]http://img112.imageshack.us/img112/7857/errorpc9.png[/img]

I also read the mingw32.txt file. I still question whether MinGW or Cygwin are relevant for my purpose. How are they part of the program?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

usernamed
Member #9,864
June 2008

Thanks for the link. I have it setup.

I placed the downloaded package into a folder named DevPak inside my Dev C++ folder. I decided to run the flowing code to make sure Dev C++ recognized the library.

#include <allegro.h>
using namespace std;

int main() {
return 0;
}

Dev C++ doesn't give me a non-existent error but instead it opens opens up base.h in a separate tab then displays the following error messages.

http://img175.imageshack.us/img175/4222/basehbc6.jpg

Whenever I compile again without changing anything, I get these message.

http://img501.imageshack.us/img501/935/othererrortj5.jpg

Did I install it wrong? Is there anything else I need to do?

LennyLen
Member #5,313
December 2004
avatar

You need to link the Allegro library to your project. Linker options are somewhere in the Project Options window (My copy of Dev-C++ always crashes when I open this window, so I can't be more specific).

edit: fixed wording

edit: The Allegro library is named liballeg.a it will be in your Dev-Cpp\lib directory.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

usernamed
Member #9,864
June 2008

I think it's looking good so far. I'm just testing it now and I came across 2 issues.

A: I write the code above and it works. I intentional put an error in the code to see what the error message spits back out at me. It opens the base.h file again. I'll remove the error, then compile again with the same error. Doubtful, I press Ctrl+F9 again and it's fine. Basically I didn't change anything but for some reason my third compile was better than my second. Is that normal?

B: I found a sample code that's apparently suppose to change your screen resolution to 640x480.

Quote:

#include <allegro.h>

int main(){

allegro_init();
install_keyboard();
set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);

readkey();

return 0;

}
END_OF_MAIN();

...the sample came with the semicolon at the end for some reason. It compiles with no error, but when I run it, the screen goes black. I removed the semicolon and the screen still goes black.

If it helps at all, I'm using an Nvidia 8 series card with the latest drivers.

wiseguy
Member #44
April 2000
avatar

If the screen is going black then the program is working. You actually have to draw something to the screen setting the graphics mode to change that.

usernamed
Member #9,864
June 2008

Ah, I'm relived to hear that. Thank you so much for helping me and putting up with my questions;D

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Where's the sample code from? A lot of people seem to see that code then use it and it's annoying to have to tell everyone repeatedly not to use a semi-colon. Having a semi-colon there may not do anything for a lot of people but it's still incorrect.

usernamed
Member #9,864
June 2008

Go to: