Im using DevCPP with Allegro and C++. I have a program Im making and so far the coding went excellent no errors at all, then when I ran it it was black for maybe 4 seconds and then said "Would you like to send an error report" and when I click dont send it just exits the program. Idk what is wrong but if you know that would be appreciated here is my code

Warning: This function can be very dangerous to use, since the whole program may get locked while the bitmap is locked. So the lock should only be held for a short time, and you should not call anything but drawing operations onto the locked video bitmap while a lock is in place. Especially don't call things like show_mouse (or scare_mouse which calls that) or readkey, since it will most likely deadlock your entire program.

In C++, you might get away with declaring and testing the value all in line, but in C, you can't, which is why I removed the dclaration. I always prefer to declare all variables in one place rather than when I first use them anyway.

If you feel you absolutely MUST declare them when you first use them, then you can use this method of testing:

Ya it turns out they are failing to load. I tried that error message and sure enough it returned the error message. I even tried renaming the bmp's to 1,2,3,4 to make sure that they are not misspelled but they still failed to load.

EDIt; ok i got it my pics arent valid for some reason. I used different pics and they worked so I now know its the pics thanks for the help!

You probably have the .bmp files in the wrong directory. IIRC, Dev-C++ creates a directory for your project, then it creates a DEBUG and RELEASE subdirectory within that where the executables will be. Put the .bmp files in the project directory, not in the subdirectory with the .exe.

I used to put my bitmap files in the wrong directory to. None of the tutorials I read said anything about it. Finally I found out that with Dev-c++, you put it in the folder called Dev-c++ where all your c++ files are saved automatically saved to.