[SDL] Getting rid of stdout redirect

Philip D. Bober wildfire1138 at mchsi.com
Tue Jan 18 07:17:50 PST 2005

jimrandomh wrote:
> By default, SDLmain redirects stdout and stderr to files. This is a 
> configure-time option in the static portion of the library. For my 
> program, this is blatantly wrong behavior and not acceptable (dedicated 
> server using SDL that's expected to be interactive on stdin/stdout). 
> Now, I can recompile SDL to not do this, but...
> I can't really tell someone who downloads a source tarball that they 
> need to recompile SDL with a nonstandard option, and I *certainly* 
> can't make a configure check for it. My present workaround is to 
> compile SDL_win32_main.c directly into the project with 
> NO_STDIO_REDIRECT defined, but that's clearly an ugly hack/bad idea.
> Is there any way to *cleanly* work around this? Better behavior would 
> be for SDL to wait until sdlInit is called, and provide an option to 
> control whether stdio should be redirected. Or best of all, just drop 
> the redirection thing entirely and provide a library function for it.
Have you tried switching to a CONSOLE project? I believe that should 
shut off the redirection.

More information about the SDL mailing list