Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Installing Allegro 5 with Code::Blocks and MinGW problems

This thread is locked; no one can reply to it. rss feed Print
Installing Allegro 5 with Code::Blocks and MinGW problems
lordalaqua
Member #13,715
November 2011

Hello, I'm completely new to allegro, and I have tried every tutorial for installing it I found through the internet, but none seems to work for me. I use Windows 7, 64 bit, Code Blocks 10.5 and I'm trying to install Allegro 5.

My latest hope was the one I found on this thread: http://www.allegro.cc/forums/thread/606041

I follow every instruction as it is written, have no problems whatsoever during the installation, even when I build the example program there's no warning. However, when I try run the example, I get:

Assertion failed: dm.dmFields & 0x00100000, file C:\CodeBlocks\allegro\src\win\wsystem.c, line 361

And Windows closes the program.

From what I've found on the net, this is due to the assertion on the wsystem file in line 361 being false, but I never modified it, so I don't get this problem at all.
I've searched the forums for a similar problem without success, so I'm writing here, hoping anyone can help me, because I really want to use allegro, but it's like my 5th failed installation method.
Also, if the thread I was following does not work, please tell me so I can try another way, and If anyone knows the best, with the smallest chance of error method to install allegro with my specs, please tell me.

Thanks for the attention and I hope someone can help me solve this.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

AMCerasoli
Member #11,955
May 2010
avatar

Have you tried the one in the Wiki?.

lordalaqua
Member #13,715
November 2011

Actually I did, otherwise I wouldn't come here to ask, but I guess it doesn't hurt to try again, when I used the tutorial from the wiki I had a strange problem:

Everything compiled OK, but when I ran the program I got the normal black console window I get when compiling any C program, and another window I couldn't see, but it was in the taskbar, and I could see the preview window from windows 7, and there was the program running, but I can't actually see it, just the preview-thing in the taskbar... I don't know if I made myself clear, if not tell me.

Does anyone know if this can be fixed, or did I install something wrong?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

lordalaqua
Member #13,715
November 2011

Edgar Reynaldo, thank you so much! It worked!
I was really looking forward to using allegro, and I just couldn't get it to work, but now I'll finally start having fun with it, thanks!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

No problem.

If you want to center the window, use al_get_monitor_info.

ALLEGRO_MONITOR_INFO i;
al_get_monitor_info(ALLEGRO_DEFAULT_DISPLAY_ADAPTER , &i);
int monwidth = i.x2 - i.x1;// + 1?
int monheight = i.y2 - i.y1;// + 1?
al_set_new_display_position((monwidth - windowwidth)/2 , (monheight - windowheight)/2);
ALLEGRO_DISPLAY* display = al_create_display(windowwidth , windowheight);

Go to: