Jump to content
  • Advertisement
Sign in to follow this  
tstrimp

Hopefully very easy SDL question.

This topic is 4948 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!