🔒 Locked
Release mode
Advertisement
Original Post
when compiling in release mode i was having the problem on the arrow keys not working, i fixed all that and initialized all my uninitialized variables but now when i run the program, right after the first frame it gives me an error box saying... "Unhandled exception at 0x00400031 in Galaga Adventure Release.exe: 0xC0000005: Access violation writing location 0x00000000." then another box after that "There is no source code available for the current location." what's that mean?
In debug mode, sprinkle assert(...) statements throughout your code. It may have the answer that debug may not catch.
using a null pointer?
what will assert do? and how would i use it?
Quote:
Original post by EvilKnuckles666
what will assert do? and how would i use it?
Assert is a function you can use to test for errors, it'll online run in debug mode and therefore wont affect the performance of your final executable.
To use assert you need to "#include
#include <cassert>int main(){int a = 4;int b = 5;a+=b;assert(a==4);}This would pop up a message box in debug mode because a aint 4. You can use this to check if your pointers is NULL.
assert(expression);
Simple as that. Expression evaluates to a bool. If it is false, it will cause your program to stop on the assertion. Useful for checking variables in debug mode. In release mode, asserts are ignored. It is part of standard c++ and is in the include file
See msdn.
Edit: Beaten by 8 seconds.
Simple as that. Expression evaluates to a bool. If it is false, it will cause your program to stop on the assertion. Useful for checking variables in debug mode. In release mode, asserts are ignored. It is part of standard c++ and is in the include file
See msdn.
Edit: Beaten by 8 seconds.
is there any other way i could figure it out? i have lots and lots of code...
and sry if it's off topic but what does:
"DMIME: Couldn't find SegState in GetParam call."
mean while i'm running the program.
"DMIME: Couldn't find SegState in GetParam call."
mean while i'm running the program.
call stack shows:
> Galaga Adventure Release.exe!00400038()
ff016aec()
i don't even know what that is...
> Galaga Adventure Release.exe!00400038()
ff016aec()
i don't even know what that is...
nope, that's all it is...
You can turn on symbols for your release builds also. That way when you get a crash, you'll also get a call stack and the error should be easy to find.
In project Properties, under the C/C++ -> General tab, select Debug Information Format to be "Program Database". Then do a full rebuild, and run your program. Note that some things may be inlined or obfuscated because of the optimizations done in release, but it'll give you a good place to start looking.
In project Properties, under the C/C++ -> General tab, select Debug Information Format to be "Program Database". Then do a full rebuild, and run your program. Note that some things may be inlined or obfuscated because of the optimizations done in release, but it'll give you a good place to start looking.
If you found exactly at what point the runtime error occures you can compile as debug mode and put a breakpoint at the first place that handles the event that caused the error and go step step and see if you are accesing "forbiden" places.
If the error occures when the program starts just go from the main function step step and find it.
the access violation usually happens when some function (usually Win32 or C Run Time) failes and returns NULL and you save that value into some varaible, lets say Handle, and you don't check an error and use Handle as a parameter for other functions or just try to write into the address which Handle points at, which is 0x00000000...
If the error occures when the program starts just go from the main function step step and find it.
the access violation usually happens when some function (usually Win32 or C Run Time) failes and returns NULL and you save that value into some varaible, lets say Handle, and you don't check an error and use Handle as a parameter for other functions or just try to write into the address which Handle points at, which is 0x00000000...
well, i just checked and for release mode the c++ general setting is already Program Database and i'm still only getting what u saw in my last post above.
Quote:
Original post by EvilKnuckles666
well, i just checked and for release mode the c++ general setting is already Program Database and i'm still only getting what u saw in my last post above.
Think you also need to enable debug info generation in linker settings.
In the same project properties window open Configuration Properties -> Linker -> Debugging and set 'Generate Debug Info' field to "Yes" ... you might optionally have to specify location for program database file in the field below that one.
ok, i'll try that.
the ? mark wasn't really for anyone, just waiting i guess; no hard feelings to anyone.
the ? mark wasn't really for anyone, just waiting i guess; no hard feelings to anyone.
well... i already have that enabled.. is it supposed to show something? or how's it work?
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement