Jump to content
  • Advertisement
Sign in to follow this  
roos

Viewing stdout/stderr in Visual C++

This topic is 4851 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, I'm working on a cross platform game (using SDL) with some folks, and the standard for reporting errors on the project is to use cout/cerr... This works fine when I'm working in Linux, but I do most of my work in Windows, and the problem is that when you use cout/cerr in Windows they don't do anything since there's no "console" per se, it's just a window. So, does anyone know if there's some option to bring up a console inside Visual Studio or something? It'd be much easier than having to write some kind of logging function which has an ifdef for WIN32 which uses OutputDebugString() on windows and cout for everything else, and then telling all my teammates to change their code to use it... Thanks very much! roos

Share this post


Link to post
Share on other sites
Advertisement
You can compile SDL applications as console applications, and you'll get a console window that stdout/stderr should output to.

Share this post


Link to post
Share on other sites
SDL redirects stdout and stderr (which are output to by cout/cerr) to stdout.txt and stderr.txt of the current working directory by default on windows IIRC.

Share this post


Link to post
Share on other sites
Wow, you guys rock! That was much easier than I'd feared :) Thanks a million :D

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!