Jump to content

  • Log In with Google      Sign In   
  • Create Account


cout to console in SDL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
41 replies to this topic

#41 maclark   Members   -  Reputation: 100

Like
0Likes
Like

Posted 07 November 2011 - 09:35 AM

I'm also looking to use cout in my SDL project. Including the lines

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

works while running. I'm working in code blocks and I check console application and pause after execution. The problem is when I try to exit, I get what I think is a seg fault, "Process terminated with status -1073741510". I guess this corresponds to a seg fault, according to my google searches. Sometimes it crashes completely. I've tried moving the freopen to before and after SDL_Init() and I've tried including fclose( stdout ) and fclose (stderr) at various places. Am I missing something? Is there a safe way end the program once you override SDL using freopen? I'm not too sure exactly what freopen does, anyway. Thanks.

Sponsor:

#42 fastcall22   Crossbones+   -  Reputation: 4112

Like
0Likes
Like

Posted 07 November 2011 - 10:31 AM

Please do not necro 7-year old threads; start a new thread instead.
c3RhdGljIGNoYXIgeW91cl9tb21bMVVMTCA8PCA2NF07CnNwcmludGYoeW91cl9tb20sICJpcyBmYXQiKTs=




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS