Skip to main content
gamedev.net
🔒 Locked

Release mode

Started by BloodLust666 18 replies 1.2k views
Original Post
BloodLust666
BloodLust666
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?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
superdeveloper
superdeveloper
In debug mode, sprinkle assert(...) statements throughout your code. It may have the answer that debug may not catch.
BloodLust666
BloodLust666
what will assert do? and how would i use it?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
CTar
CTar
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 " then you can use it like this:

#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.
njpaul
njpaul
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.
BloodLust666
BloodLust666
is there any other way i could figure it out? i have lots and lots of code...
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
BloodLust666
BloodLust666
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.
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
BloodLust666
BloodLust666
call stack shows:

> Galaga Adventure Release.exe!00400038()
ff016aec()

i don't even know what that is...
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
CTar
CTar
Quote:
Original post by EvilKnuckles666
call stack shows:

> Galaga Adventure Release.exe!00400038()
ff016aec()

i don't even know what that is...


Doesn't it have other lines too?
BloodLust666
BloodLust666
nope, that's all it is...

-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
ajas95
ajas95
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.
UriKiller
UriKiller
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...
BloodLust666
BloodLust666
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.
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
BloodLust666
BloodLust666
?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
UriKiller
UriKiller
who was that question mark pointed to?
tolaris
tolaris
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.
BloodLust666
BloodLust666
ok, i'll try that.

the ? mark wasn't really for anyone, just waiting i guess; no hard feelings to anyone.
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
BloodLust666
BloodLust666
well... i already have that enabled.. is it supposed to show something? or how's it work?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.