SDL Bug?

Hey maybe one of you guys can help me with this. Using wxDev-C++ version 7.3.1.3 with SDL 1.2 library I can get an extremly basic application to compile and run with out errors but the first line of code NEVER executes. Has any one ele run across this?


My Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <cstdlib>
#include <iostream>
#include <SDL.h>

using namespace std;

int main(int argc, char *argv[])
{
    cout << "WoooHooo\n";
    
    system("PAUSE");
    return EXIT_SUCCESS;
}


I'm linking to ming32.lib, SDLmain.a and SDL.dll.a in that order as per the tutorial linked on the SDL website. This has been tested on two seperate systems with two seperate Antivirus programs (Kaspersky and Symantec Corporate Edition) Windows XP 32-bit Service Pack 2 and Service Pack 3. The google powered search function on the www.libsdl.com turns up nothing in this regard and I'm hoping at least recreate this so that it can be reported.
It has nothing to do with SDL. I'm sure if you remove line 3 and don't link against SDL the same thing occurs.
Change line 9 to

std::cout << "WoooHooo" << std::endl;

and see if it goes away.
Hmm well SDL redirects your cout to a file. use these two lines of code right after the left curly brace in your program to fix it.

freopen("CON", "w", stdout);
freopen("CON", "w", stderr);
Wow, you would think that the tutorial would have mentiond that both cin and cout are redirected before it told you to experiment with the code. Thanks a lot guys wxdev drops the exe in another folder so I didn't even notice the file it was creating.
Topic archived. No new replies allowed.