Jump to content
  • Advertisement
Sign in to follow this  
woofbluddywoof

printf() in release mode

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

Hi guys - sorry if this is a really dumb question but I'm currently creating my first release build and am having some problems. I'm trying to resolve this by debugging using printf() but nothing's geting outputed to stout (works fine in Debug mode). Do I need to set this up manually or something when running in release mode?

cheers.

Share this post


Link to post
Share on other sites
Advertisement

Hi guys - sorry if this is a really dumb question but I'm currently creating my first release build and am having some problems. I'm trying to resolve this by debugging using printf() but nothing's geting outputed to stout (works fine in Debug mode). Do I need to set this up manually or something when running in release mode?

cheers.


I would enable debug symbols in release instead of doing printf's. Hopefully you're using windows and visual studio as thats the only platform/IDE I know how to enable it in. Right click your project in the solution explorer, and select properties. Goto "C/C++", and under "Debug Information Format" make sure its set to Zi, next goto the subcategory "optimization", and disable it (/Od). Navigate to the linker tab then subcat "Debugging", and turn "Generate Debug Info" to Yes (/Debug). Clean / rebuild and you should be able to debug in release mode. Do that then nasty printf's!!!

Share this post


Link to post
Share on other sites
In gcc you can use option -g to make sure the debugging information is available.

However, using printf should always work. Try flushing stdout (probably what you mean by "stout") after your call printf (using fflush), or try using stderr instead (which should not be buffered).

Share this post


Link to post
Share on other sites
Hi, thanks for the help guys - setting up the debugging in release is definitely pretty useful so cheers for that.
i also figured out that printf was only not working in the release version when I was running it from inside visual studio (for whatever reason) - just running externally prints out fine.

Thanks for all the help!

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.

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!