Jump to content
  • Advertisement
Sign in to follow this  
George Jennison

ERROR: R6010

This topic is 2349 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]

#include <allegro.h>

int main()
{
allegro_init();
install_keyboard();
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);

BITMAP* buffer = create_bitmap(640, 480);

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

while(!key[KEY_ESC])
{
blit(bg, buffer, 0, 0, 0, 0, 640, 480);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}

destroy_bitmap(buffer);
destroy_bitmap(bg);

return 0;
}
END_OF_MAIN();
[/font]

Share this post


Link to post
Share on other sites
Advertisement
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  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!