Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SKSlayer

Program crashing in release

This topic is 6597 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

I use VC++ 6 When I compile my program in DEBUG mode, everything is perfect, then links corretly, then runs correctly If I compile now in Release mode, everything compile correctly at link time, I get a :
    
LINK : warning LNK4089: all references to ADVAPI32.dll discarded by /OPT:REF
    
Then, the program runs and crashes immedately without I see anything on the screen

Share this post


Link to post
Share on other sites
Advertisement
The crash has nothing to do with the linker warning - it''s most likely a variable not initialised ( they get initialised to 0 or some equivalent in Debug mode ) or having critical code within an "ASSERT" block.


Give me one more medicated peaceful moment.
~ (V)^|) |<é!t|-| ~
ERROR: Your beta-version of Life1.0 has expired. Please upgrade to the full version. All important social functions will be disabled from now on.

Share this post


Link to post
Share on other sites
Well if you get no error message, it''s perhaps just terminating because of an internal error condition. Do you have any logging?


Give me one more medicated peaceful moment.
~ (V)^|) |<é!t|-| ~
ERROR: Your beta-version of Life1.0 has expired. Please upgrade to the full version. All important social functions will be disabled from now on.

Share this post


Link to post
Share on other sites
I''ve had this same problem myself. MadKeithV is right about debug mode automatically initializing all variables to 0, while in release this doesn''t happen. It makes it much tougher to debug problems in debug when the compiler covers them up like that.

Anyways, using a logging system like MadKeithV suggested is your best option. If you don''t go that route, then you are forced down the route of commenting out everything but the very basic skeleton code to run your program. If it runs fine, then uncomment half your code, and run the program again. If it crashes, then you know the bug is in that half of the code. Lather, rinse, repeat until you get the line/lines thats causing the problem.

Just remember a good rule of thumb: always periodically compile and run your programs in release mode to make sure everything is still running fine. The longer you wait the harder it will be to track down that bug...

Share this post


Link to post
Share on other sites
No C specification states that variables need to be initialised to ''0''. Not that VC++ is particularly compliant with ANSI spec. anyways....

Share this post


Link to post
Share on other sites
It really bothers me going from C++ to languages like Eiffel. In Eiffel, everything is too fixed for my liking. I like my strings to start at array index 0 and go until I reach a null, not start at 1 and go until my index is eaqual to a function return (mystring.count as it were). I love C++ for not being strict, so initialise EVERYTHING the way that you want it, don''t assume anything... Trust NOBODY (No variable initialisation that is)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-Chris Bennett of Dwarfsoft
"The Philosophers' Stone of Programming Alchemy"
IOL (The list formerly known as NPCAI) - A GDNet production
Our Doc - The future of RPGs
Thanks to all the goblins over in our little Game Design Corner niche
          

Share this post


Link to post
Share on other sites

  • 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!