[Allegro 5] Game Crash

Started by
17 comments, last by WillTice 11 years, 6 months ago
http://alleg.sourcef....0.7/image.html

it exists. Maybe you're not linking right. Hmm

EDIT:

I'm sorry

#include <allegro5/allegro_image.h>

all better?
Advertisement
Nope, still crashes at line 59.
A Noobie C++ Developer.

I use Code::Blocks with GNU GCC Compiler, and Allegro 5 Libraries.

I'm a W.I.P., please be patient with me!
Assign the return value of al_get_backbuffer and make sure it's valid. Probably it's returning null? I don't know allegro but did you initialize it with the option of using the backbuffer?
Change line 41 to:

if(display == NULL) {

The manual says that al_create_display returns NULL, so don't assume it's Boolean value.
After I changed line 41 (49 in the code w/Breakpoints&and the new #include by shaquil) to that, the program got compiled & ran just fine, but it still crashed at line 59. (73 in my code)
A Noobie C++ Developer.

I use Code::Blocks with GNU GCC Compiler, and Allegro 5 Libraries.

I'm a W.I.P., please be patient with me!

Change line 41 to:

if(display == NULL) {

The manual says that al_create_display returns NULL, so don't assume it's Boolean value.



That's a waste of time. if(!display) and if(display == NULL) are the same exact thing.

Also, remove my suggestion of the image addon stuff. I was wrong. I've run your code in Visual Studio 2012 Professional. It worked. I've attached a screenshot in dual-screen mode. I have no idea how to make allegro work with codeblocks, so I can't help you with figuring out what possible linkage problems might be occuring.
hmmm...

Well, here's my .cbp (Code Blocks Project file) that contains my .cpp file:

- { http://codepad.org/JCrRLUFQ } -
A Noobie C++ Developer.

I use Code::Blocks with GNU GCC Compiler, and Allegro 5 Libraries.

I'm a W.I.P., please be patient with me!
that code says there's something wrong on line 11. Could that be it? I hope you figure this out. I'm honestly perplexed. It seems like something going on under the API itself. Or maybe you've downloaded a version of allegro that isn't compatible with whatever compiler code::blocks uses. Try allegro.cc, the users on that forum are active and knowledgable. It seems very few people here honestly use allegro.

that code says there's something wrong on line 11. Could that be it?

Highly doubtful, considering that codepad is trying to compile the cbp file as C++ code.

I also second allegro.cc for some help.

This topic is closed to new replies.

Advertisement