I am very noobish into C++, Allegro, Compilers and whatsoever and i definately need a lot of help
Well i wrote that piece of code some weeks ago under Allegro 5.0.6, using Codeblocks 10.5 and their integrated MingW/Gcc compiler thingie. Today finally i could manage to spend some time learning and programming again. The odd thing is I must have broken either my IDE or my compiler when I paused, because lots and lots of linking errors and other bugs I don't know about.
So I invested some time and got Codeblocks, the newest version of MingW and of course Allegro running, finally. Took me quite a while to figure it all out. When I started my little programm it just showed up there for a second, then crashed, saying:
Process returned -1073741819 (0xC0000005)
After some time looking for that stuff on google, i knew it was some memory accessing/allocating problem. The last couple hours I spent testing my code with al_rest() and some other nice ideas I had, for showing me when exactly this problem occurs.
I started another testproject, in which I copied all the necessary stuff, testing again and again, copying and finally it crashed. Some more time spend testing, I now know that the problem occurs at
ScreenWidth = 200;
ScreenHeight = 200;
WindowPositionX = 500;
WindowPositionY = 200;
done = false;
ALLEGRO_WINDOWED); // Set the Game in Windowmode (or Fullscreen or resizeable)
18 ALLEGRO_DISPLAY *
NULL; // Create the Display via Variable
display = al_create_display(
ScreenWidth,ScreenHeight); // Set the Display to specific size
display, WindowPositionX,WindowPositionY); // Set the Position of the Game-Window
display, "Allegro TEST"); // Set the Window Title
NULL, NULL, NULL, "I have failed to initialize the display"
, NULL, NULL);
25 return -1;
28 if(!al_install_keyboard()) // Init Keyboard
NULL, NULL, NULL, "I have failed to initialize your keyboard"
, NULL, NULL);
31 return -1;
34 if(!al_install_mouse()) // Init Mouse
NULL, NULL, NULL, "I have failed to initialize your mouse"
, NULL, NULL);
37 return -1;
display); // Hides the Mousecursor
42 ALLEGRO_EVENT_QUEUE *
NULL; // Create the Input-Queue
event_queue = al_create_event_queue(); // Set the Event Queue to catch something
event_queue, al_get_keyboard_event_source()); // Keyboard to Event Queue
event_queue, al_get_mouse_event_source()); // Mouse to Event Queue
50 // Initializing the Crosshair
ev; // Create the Event Variable
ev); // Wait for input
ALLEGRO_EVENT_MOUSE_AXES) // Mouse Movement
ALLEGRO_EVENT_DISPLAY_CLOSE) // Press the Window Close Button
done = true;
73 al_flip_display(); // Buffer to Screen
,0)); // Reset the Buffer to Black
79 return 0;
The funny thing is:
If i out-comment the al_clear_to_color statement, the window will show up and stay without errors.
What is happening there?
I think i "fixed" the problem. Installing Allegro on my "old" MingW inside the Codeblocks folder and adding the libstdc++6.dll (what caused other problems in the first place) solved my issue. I just don't know why my new MingW doesn't want to do that stuff the right way.
I finally found some version data too:
So it works with the old one for now