   SDL and stdout/stderr
  It's been a while since I've touched SDL, but I'd like to get back into it, for a cross-platform game. I think one of the things I _REALLY_ didn't like about SDL when I first tried tinkering with it is that in Windows, stdout and stderr are redirected to txt files. In Linux, it was nice to see stuff happen on the fly. In Windows, you only actually get to see stderr.txt if the stupid program exits successfully (which is when you typically don't end up needing it hehe).Is there a way to redirect that stuff in Windows? I will typically generate a makefile using Dev-C++ and work off a console anyway, so it would be nice to see my output there. I guess this is not a blocker, since I have my own log stuff, but it would be good to know the designers thought of this too :-).   
  Add#ifdef main#undef main#endifbefore the main function.   ;  If you are compiling from source then define NO_STDIO_REDIRECT and std(out/in/err) will not be redirected to a those files.So just add this line before SDL.h or in you compiler options.#define NO_STDIO_REDIRECT If you are using pre-build libraries then do it manually. Try adding these statements at the programs very beginning.NOTE: Some people use "CON" instead of NULLfreopen(NULL,"w",stdout);freopen(NULL,"w",stdout);freopen(NULL,"w",stderr);[Edit- Posted to soon without trying out these methods:(The only way to stop the creation of these file is to recompile SDL with NO_STDIO_REDIRECT defined.Otherwise you have to put up with those file and redirect those stream in your program with freopen().See SDL: disabling stdout.txt or cout to console in SDLfor more info.][Edited by - Jack Sotac on May 5, 2006 2:57:43 PM];Quote:Original post by Jack SotacIf you define NO_STDIO_REDIRECT then std(out/in/err) will not be redirected to a those files.So just add this line before SDL.h or in you compiler options.#define NO_STDIO_REDIRECT BTW. The standard function they use for redirecting these streams is freopen().oOOoo I'll have to try that one. I've seen various hacks for it and the one I posted above was the cleanest I've found.   ;  Ah thanks for the info, I'll put it to good use!   ;  Hey guys,  how would you reset the stdout back to its original state after this? THis is in the case, that you only wanted to redirect stdout to NULL temporarily in a program, but reset it back right after.   Any help is appreciated.... stony-brook   