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   Members   

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.

#42   Moderators   

9747
Like
0Likes
Like

Posted 07 November 2011 - 10:31 AM

Please do not necro 7-year old threads; start a new thread instead.
zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC




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.