Hi there,
I create an new SDL project and everything is fine.
But, if I want an output trough printf or cout, nothing is in the console. Is there anything wrong, is it generally possible?
If you speak german, you can answer me in german :-)
Greetz
I believe SDL redirects all output intended for stdout/stderr to files stdout.txt/stderr.txt. Check the folder your program runs in for those files.
yeah, there is it, thanks
is it possible, that sdl redirect it in the console?
Quote from: Feuer on January 07, 2007, 10:05:38 PM
yeah, there is it, thanks
is it possible, that sdl redirect it in the console?
Yes it is, just add the following lines to your code (after SDL_Init)
freopen("CON", "w", stdout); // redirects stdout
freopen("CON", "w", stderr); // redirects stderr
it works!
thanks
There is an even easier way.... SDL has some constant that you can #define so it does not redirect in the first place. I don't remember what the constant was, but it's in the docs somewhere.
ok thanks,
I try to find it