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   -  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.

#42   Crossbones+   -  Reputation: 9169

Like
0Likes
Like

Posted 07 November 2011 - 10:31 AM

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

gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=





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