Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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: 5753

Like
0Likes
Like

Posted 07 November 2011 - 10:31 AM

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




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