Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printf is not printing anything to output? C++ SDL

I am trying to use "printf" in my Visual C++ project however it is not working. Using Lazy Foo's tutorial, I set up SDL in my project, but when I play it, printf doesnt do anything.

#include "SDL.h"
#include <stdio.h>

int main( int argc, char* args[] ) {
    printf("Testing");
    return 0;
}

The output looks like this:

The program '[4664] SDL Testing.exe: Native' has exited with code 0 (0x0).

And that's about it. What could be wrong?

like image 498
Qasim Avatar asked Jun 17 '12 02:06

Qasim


2 Answers

Bring up the projects properties, go to linker->system->subsystem and change it to the third option, CONSOLE. That should do it

like image 139
DaKrazyKatt Avatar answered Oct 17 '22 02:10

DaKrazyKatt


SDL by default redirects stdout to a file, stdout.txt. You should find it in your program's working directory.

like image 43
jrok Avatar answered Oct 17 '22 01:10

jrok