So here is what i have done
I did the basics of c++ and was quite comfortable with them
Now i wanted to start with the allegro gaming library
so i downloaded the library and linked it with my compiler
i compile a program and it compiles fine but when it runs it just displays and blank screen saying windows application at top
What do i do?
Please Help
Here is my code:-

#include <allegro.h>
int x = 10;
int y = 10;
int main(){
    set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
    while ( !key[KEY_ESC] ){
        textout_ex( screen, font, " ", x, y, makecol( 0, 0, 0), makecol( 0, 0, 0) );
        if (key[KEY_UP]) --y;        
        else if (key[KEY_DOWN]) ++y;    
        else if (key[KEY_RIGHT]) ++x;
        else if (key[KEY_LEFT]) --x;
        textout_ex( screen, font, "@", x, y, makecol( 255, 0, 0), makecol( 0, 0, 0) );
    return 0;
6 Years
Discussion Span
Last Post by DeanMSands3

What version of Allegro are you using? That looks like older Allegro code.
Allegro 5 uses a whole new API.
I compiled Allegro 5 on my system using MSYS, MinGW and CMake.
Then I tried compiling that code. Didn't take.
Tried code from the Wiki.
Worked without any problem.


If you go with Eclipse or NetBeans (and I recommend it), you'll need an external compiler.

MinGW is a GNU C Compiler suite for Windows. And it's pretty sweet.
You can either get the original or TDM-GCC (which is an unintentional pun on "tedium").

MSys is a minimal system which provides a Unix-like environment to compile the code in.
If you want a Make system (you do, but you probably don't know it yet), you want MSys.
If you have external libraries or programs that ask for the "./configure && make && make install" method, you want MSys.
Seriously. You. Want. MSys.

CMake is a program that replaces configure to generate the make files. This is often pretty helpful. You will eventually want this.

All of which are easily googled.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.