views:

439

answers:

1

im currently using the SDL-devel-1.2.13-mingw32 library in code blocks 8.02. with the mingw 5.1.6 installed separately on C:\ this program compiles and runs with no errors but i can't see the last system("pause"); on the screen. When i press any key, it of course skips over the system("pause"); then code blocks tells me that it successful ran. It also doesn'w show the cout << " SDL \n"; WTF?

#include <iostream>
#include <SDL.h>
using namespace std;

int main(int argc, char *argv[])
{
    cout << " SDL \n";
    cout << endl;

    if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) == -1) {
     cerr << "Failed to initialize SDL: " << SDL_GetError() << endl;
     exit(1);
    }
    atexit(SDL_Quit);
    system("pause");`
    return 0;
}
A: 

Depending on the options used to compile SDL, console output may be redirected to files called stdout.txt and stderr.txt -- this is the default for most Windows builds.

See this wiki article for a solution: http://www.libsdl.org/cgi/docwiki.cgi/FAQ%5FConsole

luft
i tried the all that code and the console is giving me alien output
TheFuzz
where would the *.txt files be?
TheFuzz
In the program's working directory. They may be deleted when the program terminates.
luft