• Advertisement
Sign in to follow this  

Hopefully very easy SDL question.

This topic is 4686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm just got SDL setup to run with Code::Blocks and I run into a problem while trying to output to the console after including SDL.h. Here is the code:
#include <iostream>
#include "SDL/SDL.h"

int main(int argc, char *argv[])
{
    std::cout << "Hello World" << std::endl;
}

Simple eh? No compiler errors and the program runs however it does not display anything to the console. When I comment out the SDL include then it compiles fine and DOES write Hello World to the console. Any ideas? I tried a little searching on google but without luck. I've used SDL successfuly many times before but always while using VC++.

Share this post


Link to post
Share on other sites
Advertisement
This is an issue with the MingW - GCC compiler that Dev-CPP uses as well as Code::Blocks uses. Here's the thread that took forever + 1 in figuring out the problem [wink]. See if you can use that to get it working again.

Share this post


Link to post
Share on other sites
Thanks a lot Drew! I'd rate you up but I already have for some reason.

Share this post


Link to post
Share on other sites
I see you solved your problem, but anyways, SDL on Windows freopens stdout to stdout.txt and stderr to stderr.txt, so look for those files in your program directory.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement