Jump to content
  • Advertisement
Sign in to follow this  
Decrius

[SDL] Console instead of stderr/stdout

This topic is 3881 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, SDL seems to create stderr and stdout files. Can I set that it won't create those files when running? Also: how can I use std::cout and std::cin together with SDL, it seems that every output goes to the stdout file instead of to the console. How can I fix this? Running WinXP, CodeBlocks and MingW. Programming in C++

Share this post


Link to post
Share on other sites
Advertisement
Yeah tried that already, but it seems that SDLmain has set that output should go to these files instead of to the console.

This can be avoided though with putting the following after SDL_Init():

freopen("CON", "w", stdout);
freopen("CON", "w", stderr);

However, this is a bit buggy, so I decided to use SDL_ttf instead ;).

Thank you anyways

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!