Sign in to follow this  

ERROR: R6010

This topic is 2102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[font=Verdana, sans-serif]I created a simple program in in C++ and allegro in Visual C++ 2010 Express.[/font]

[font=Verdana, sans-serif]It works fine; I get no compiler errors. BUT, when I try to run the program I get a Message Box that says:[/font]
[font=Verdana, sans-serif](Window Caption) "Microsoft Visual C++ Debug Library"[/font]
[font=Verdana, sans-serif](error) "Debug Error![/font]
[font=Verdana, sans-serif]Program: ...e\Desktop\programming\c++\visual\2010\BlockZ\Debug\BlockZ.exe[/font]

[font=Verdana, sans-serif]R6010[/font]
[font=Verdana, sans-serif]- abort() has been called[/font]

[font=Verdana, sans-serif](Press Retry to debug the application)"[/font]

[font=Verdana, sans-serif]That's what it says![/font]

[font=Verdana, sans-serif]HERE'S MY CODE:[/font]
[font=Verdana, sans-serif][CODE]

#include <allegro.h>

int main()
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);

BITMAP* buffer = create_bitmap(640, 480);

BITMAP* bg = load_bitmap("bg.bmp", NULL);

blit(bg, buffer, 0, 0, 0, 0, 640, 480);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);


return 0;

Share this post

Link to post
Share on other sites
If you step through your program using the debugger you'll get a much better idea of what's going on.

You should check the return values of every function that can possibly fail. I suspect load_bitmap is failing (for instance your program my not be running with the correct setting for current directory), it is returning NULL and then you are using an invalid pointer in blit.

Share this post

Link to post
Share on other sites
Sign in to follow this