|
get 0xC0000005 on al_destroy_display() |
megasonimon
Member #14,613
October 2012
|
Hi but it crashes at al_destroy_display(display) and said Call stack: I'm using Windows 7 pro x64, Code::Blocks with TDM-GCC 4.6.1 What could be a possible reason that causes the problem? Thanks. |
Gabriel Campos
Member #12,034
June 2010
|
Show us some code, maybe u forgot something in the code that is crashing...
|
torhu
Member #2,727
September 2002
|
Are you sure that the display argument is valid? 0xC0000005 is Access Violation, which usually means a null pointer or otherwise invalid pointer is involved. Make sure you don't call al_destroy_display twice, although it's possible that that is fine. And post your code... |
megasonimon
Member #14,613
October 2012
|
well, I just copy and paste that sample code and didn't change anything 1#include <stdio.h>
2#include <allegro5/allegro.h>
3
4int main(int argc, char **argv){
5
6 ALLEGRO_DISPLAY *display = NULL;
7
8 if(!al_init()) {
9 fprintf(stderr, "failed to initialize allegro!\n");
10 return -1;
11 }
12
13 display = al_create_display(640, 480);
14 if(!display) {
15 fprintf(stderr, "failed to create display!\n");
16 return -1;
17 }
18
19 al_clear_to_color(al_map_rgb(0,0,0));
20
21 al_flip_display();
22
23 al_rest(10.0);
24
25 al_destroy_display(display);
26
27 return 0;
28}
During the tests I modified al_rest(10.0); to al_rest(1.0); to make the program go to the end faster |
torhu
Member #2,727
September 2002
|
Replace "attach" with "code" i those tags, and [] with <>. Does it actually display a window before it crashes? |
megasonimon
Member #14,613
October 2012
|
Yes, it displays a window |
torhu
Member #2,727
September 2002
|
I don't really have any good ideas here. Is that code actually copied from your editor, not from the example page? EDIT: You could attach the allegro.log file, if there is one. Maybe there is a clue in that. |
Cassio Renan
Member #14,189
April 2012
|
I got the exact same problems a few months ago, with a machine of roughly the same specs as yours(W7-pro x64, DX11), and couldn't really get it to work. I'm guessing compatibility issues, but I'm no pro. I could only solve my problem by compiling allegro from source. At the time, I posted a thread here. It has an allegro.log file, if it's any help. When I compiled from source I asked to close the topic, so there isn't really any more feedback there. Sorry about that. here's the thread. good luck! |
Kris Asick
Member #1,424
July 2001
|
megasonimon, what kind of video card/chipset do you have and are your video drivers up to date? Because you're not explicitly setting the ALLEGRO_FULLSCREEN or ALLEGRO_WINDOWED flags with al_set_new_display_flags() before calling al_create_display(), it's possible your combination of video card/chipset and driver are causing problems with Allegro's default fullscreen/windowed setting. (Which truthfully, I don't know what the default is.) --- Kris Asick (Gemini) |
megasonimon
Member #14,613
October 2012
|
adding al_set_new_display_flags(ALLEGRO_WINDOWED ); before al_create_display doesn't change anything Video Card: and where is allegro.log located? |
Neil Walker
Member #210
April 2000
|
does it fail if you remove the clear and flip? have you tried suggesting ALLEGRO_OPENGL have you recently updated your video drives? if not, do it. have you tried changing resolution to use the desktop (al_get_display_height(), etc) Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
megasonimon
Member #14,613
October 2012
|
>Neil Walker another strange thing but I compile the same code on my PC, run it on my PC causes 0xC0000005 error so there might be some problem during compile or link on my PC? >Cassio Renan |
Kris Asick
Member #1,424
July 2001
|
Are you using the same compiler and project files on both systems? If so, then there might be something wrong with your compiler/linker on the one system and you should reinstall it all completely. Also, AFAIK, Allegro is designed specifically for making 32-bit apps. Your compiler may be attempting to make a 64-bit app, in which case Allegro would be unable to load properly. You may wanna check into that too and ensure you're compiling a 32-bit app. --- Kris Asick (Gemini) |
torhu
Member #2,727
September 2002
|
megasonimon said: and where is allegro.log located? In the same directory as your executable. Or maybe the current working directory, if that's not the same. I think only the debug build of Allegro creates it though. |
megasonimon
Member #14,613
October 2012
|
>Kris Asick [Edit] I switch to dynamic link and got log file [Edit2] 10.12 |
|