Author Topic: Can't cout (using opengl, sdl, and C::B)  (Read 4853 times)

Offline Fooleo

  • Single posting newcomer
  • *
  • Posts: 2
Can't cout (using opengl, sdl, and C::B)
« on: November 07, 2010, 06:40:43 am »
Hey again. When searching to solve my problem i found this topic on THIS forum:

http://forums.codeblocks.org/index.php?topic=9841.0;prev_next=next

also this topic:

http://forums.codeblocks.org/index.php/topic,10409.0.html

And since you were all so nice as to help these people, I don't see why it is unreasonable for you all to help me. You should consider being nicer.... I could really use some help on this!

Well here is my post again. Please give me the decency of an actual response, and do not lock my topic again.
---------
I know your thinking "another one of these topics!" but i assure you i have been looking around and can not find a fix for my problem.

So after initialize SDL i tried putting this code (as was directed by other forums/sites)


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

but i got nothing. So then i tried this (as directed by another site)

Code
    if( init() == false )//initializes SDL
    {
        return 1;
    }
    ofstream ctt("CON");

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

//...game code and stuff, then right before i quit SDL:

    ctt.close();

I also tried "FILE * ctt = fopen("CON", "w" );" instead of "ofstream ctt("CON");" but i just got an error when i tried to close ctt saying that it was not of type FILE*, which is ridiculous.

What else can i do to make my program print to the console?? A lot of my debugging code utilizes the console (i was using GLUT and recently switched to SDL, which is why already have a lot of debugging code written that uses it). So I would really like to figure this out.

Thanks for your help.

Love,

Fooleo
« Last Edit: November 07, 2010, 06:42:17 am by Fooleo »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Can't cout (using opengl, sdl, and C::B)
« Reply #1 on: November 07, 2010, 08:44:45 am »
If your topic has been locked, this has a cause and it was done by an adminitrator.

If you continue violating our forum rules you might get banned from this forum/website.