It compiles fine with no errors or warnings, but then crashes when I open it. Any ideas? (trying to get it to display the png, which IS in the right place). All my dll's are linked right as well. Just opens for a split second then closes.
I know im gonna get yelled at for being a noob here, but no... Not sure how to in vc++... Im kind of in over my head a little, but im determined to learn it. How do you step through in vc++? I'll try and work on it while waiting for a reply.
Find out where these options are in VS and remember where they are (* means they're probably assigned to a hotkey -- possibly one of the F keys):
* Add/Remove breakpoint
* Run
- Step Into (button looks like {braces} with an arrow pointing inside of it)
- Step Over (button looks like {braces} with an arrow pointing around/over it)
Adding a breakpoint on a line means the program will break (or "pause") when code execution reaches that line of code. When this happens VS will bring itself to the front and have a green triangular arrow (iirc) pointing to the line of code being executed next.
When the program is broken like this, you can examine contents of your variables via the "Watch" feature (look around in the menus for it). Simply add the variable name to the Watch list and it will report the contents of that variable. You can also use breakpoints to simply know when code is being reached and when. Or to find out if code is ever being reached at all.
To get out of the program, press Run and the program will continue as normal.
Step Into and Step Over can be used to step through code to see how execution is flowing. This can be useful if a routine is broken somewhere, and you want to find out where. You can step through it line by line, keeping an eye on your watches, until you see the exact line where things are going wrong.
Both Step Into and Step Over advance to the next line of code, however if there's a function call, Step Into will step into the function, and Step Over will step over it (obviously).
---------------------
How to apply this to your problem:
put a breakpoint near the start of main, and just start stepping through everything until the program ends unexepectedly. Then you'll find out where the problem is.
well, the problem is I was missing some special files. I guess I should be happy that i made even the bmp work >.> Im not, but I should be. Next step is a moving image, then one that moves by command... wish me luck lol
I have same problem too but I solved with this way:
Measure look.png is in the same folder of executable file.
If you are windows user,measure SDL.dll SDL_image.dll libpng12-0.dll is in the same folder of executable file.
If you are linux user,measure you have libsdl and libsdl_image
Oh, I found out the problem.. the png is not loading.. commented out
.........
I guess I should be happy that i made even the bmp work >.> Im not
If there is black screen in both .png and .bmp,that most of chance is image file missing,measure look.png is in the same folder of executable file.