Need urgent assistance with my code

When I try to debug my program I get this error

Unhandled exception at 0x00F8D7C9 in MiniProject.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.

I believe it is being caused by this piece of code.

while (running) {
if (screenState[TITLESCREEN] && !screenState[GAMESCREEN]) {
ALLEGRO_EVENT titleEvent;
al_wait_for_event(eventQueue, &titleEvent);


if (titleEvent.type == ALLEGRO_EVENT_MOUSE_AXES) {
mouseX = titleEvent.mouse.x;
mouseY = titleEvent.mouse.y;
}



I also get a memset.asm not found error when jumping in the code when I reach these lines of code.


Buttons *bPlay = new Buttons();
Buttons *bHelp = new Buttons();
Buttons *bOptn = new Buttons();
Buttons *bBack = new Buttons();
Buttons *bExit = new Buttons();
Buttons *bMenu = new Buttons();
Buttons *bExit2 = new Buttons();
Buttons *bVolumeP = new Buttons();
Buttons *bVolumeM = new Buttons();
Buttons *bDifficultyP = new Buttons();
Buttons *bDifficultyM = new Buttons();


Run the program in the debugger. It will crash and the debugger will show you the line of code that the crash occurred in. You can work backwards from there to fix the problem.
I also get a memset.asm not found error when jumping in the code when I reach these lines of code

What does the constructor for the "Buttons()" object look like? Or better yet, where did you get the source code?

The '.asm' extension suggests that this is someone trying to write their own implementation of "memset()" in assembly. I only ever see that done in Linux and it will fail pretty much every time in Windows. Are you sure that you are following the correct instructions for compiling what ever this is on your platform?

Things you should include in your next post:

- The source code of this project. A hyperlink is fine.
- Your platform. Include the IDE, compiler and OS.
Topic archived. No new replies allowed.