Jump to content
  • Advertisement
Sign in to follow this  
catrexis

Problems after changing from Debug to Release

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

Heyho
I follow the tutorials from rastertek.com. I'am at Lesson 22 and tried to change my engine to release mode the first time.
Now my problem: my engine works in VS 2010 debug AND release mode.
BUT: When I start the executables in my engine-folder, the debug one is fine but the release one not.
On the right side of my spinning cube, a triangle is sometimes missing (black) and also the whole backside is lost... And I don't know why...
And why does the problem just occur, when I start the executable and not when I start it in the Visual Studio?
Could anybody help me?
Cat

Share this post


Link to post
Share on other sites
Advertisement

Without knowing the details, 80% of the time, release bugs happen due to uninitialized memory. Also, since it's in release, all debug safety nets are disabled. Find your directx control panel and make sure that you're getting all of it's output and see if you're failing anywhere or any warning that DX maybe saving your from.

Share this post


Link to post
Share on other sites


Could anybody help me?

 

Just as seabolt said, this is most likely due to e.g. some member variable not being initialized in the constructor. I'd recommend getting yourself a static code analysis tool like cppcheck. Then you can scan your source files, and it will tell you all appearences of unitialized memory (as well as other issues).

Share this post


Link to post
Share on other sites

Okay thanks for your hints so far...

I downloaded cppcheck and now I'am solving the tons of warnings (many member variables not initialized in the constructor)

 

 

Also in debug compile with warning level 4 and set treat warnings as errors, this will most of the time avoid you having extremely annoying release run issues.

 

How can I debug with warning level 4?

 

 

Find your directx control panel and make sure that you're getting all of it's output and see if you're failing anywhere or any warning that DX maybe saving your from.

 

How to use this DX Control Panel, or is it self-explaining (I didn't try it yet)?

Share this post


Link to post
Share on other sites

long ago i discovered issues with debug vs release  (weirdo string pooling behavior in some previous version of MS c++).

 

as a result, i not longer develop in debug mode at all. 

 

the first thing i do when i start a new project is set the configuration manager to release mode.

 

then i set the compiler settings for release mode, and then i start coding.

 

never really needed or used a debugger, so i don't really miss debug mode at all.

 

and best of all, i never have to deal with differences between debug and release.

 

in the end, it'll be compiled in release mode anyway. so that's what you really care abut getting working right. who care's what it does in debug mode? debug mode is just a crutch. in the long run, all that matters is whether release mode works.

 

developing in release mode also means that problems hidden by debug mode are discovered sooner. 

 

also, rastertek should be taken with a grain of salt, i've found a few bugs in their code.

Share this post


Link to post
Share on other sites

long ago i discovered issues with debug vs release  (weirdo string pooling behavior in some previous version of MS c++).

 

as a result, i not longer develop in debug mode at all. 

 

the first thing i do when i start a new project is set the configuration manager to release mode.

 

then i set the compiler settings for release mode, and then i start coding.

 

never really needed or used a debugger, so i don't really miss debug mode at all.

 

and best of all, i never have to deal with differences between debug and release.

 

in the end, it'll be compiled in release mode anyway. so that's what you really care abut getting working right. who care's what it does in debug mode? debug mode is just a crutch. in the long run, all that matters is whether release mode works.

 

developing in release mode also means that problems hidden by debug mode are discovered sooner. 

 

also, rastertek should be taken with a grain of salt, i've found a few bugs in their code.

 

This is dangerous and reckless stuff.

 

Sorry; I understand what you're saying and why you're saying it, but it's still dangerous and reckless.  Yes, the differences between debug and release builds are a total  pain in the ass, but that's no excuse.  The debugger is the most useful tool you have, and saying that you've never needed to use it speaks volumes about the quality of your code, but not in the way you think.

Share this post


Link to post
Share on other sites
...

If people were using debuggers correctly, programming forums (like GameDev) wouldn't have tons of unnecessary threads where people ask why something doesn't work as expected, including hundrets of code lines for other people to read and find the error.

Knowing how to debug your own program is maybe the most important skill of a programmer. I really don't belive that you are able to write bug-less code directly from your head.

I honestly don't know whether your post isn't just a joke or a trolling attempt, because it sounds so. Or you are maybe making just very small and simple applications.

Edited by Tom KQT

Share this post


Link to post
Share on other sites

Heyho
I follow the tutorials from rastertek.com. I'am at Lesson 22 and tried to change my engine to release mode the first time.
Now my problem: my engine works in VS 2010 debug AND release mode.
BUT: When I start the executables in my engine-folder, the debug one is fine but the release one not.
On the right side of my spinning cube, a triangle is sometimes missing (black) and also the whole backside is lost... And I don't know why...
And why does the problem just occur, when I start the executable and not when I start it in the Visual Studio?
Could anybody help me?
Cat

Besides the other advises from people (not Norman), I would also suggest you this: in the future, verify your code in both modes more often, not just when it's all done. If you know that your application was running in release mode at the end of the previous day and today it doesn't, then you just need to remember what you've added or changed today. (Of course you can go from days to hours.)

Share this post


Link to post
Share on other sites

 


Besides the other advises from people (not Norman), I would also suggest you this: in the future, verify your code in both modes more often, not just when it's all done. If you know that your application was running in release mode at the end of the previous day and today it doesn't, then you just need to remember what you've added or changed today. (Of course you can go from days to hours.)

 

I will do it in future. But your advise doesn't help me today..

 

I will write again when I got rid of all the warnings from cppcheck...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!