Reputation: 301
Sorry for my newbie-ness
Does anyone have problems getting std::cout to output when using SDL?
I can't seem to get anything shown in the output even when I comment away the SDL codes.
#include <iostream>
//#include <SDL.h>
int main(int argc, char **argv){
//if (SDL_Init(SDL_INIT_EVERYTHING) != 0){
// std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
// return 1;
//}
//SDL_Quit();
std::cout << "Testing" << std::endl;
return 0;
}
Edited: The window was closed too fast to see anything, so I added SDL_Delay(2000); after my std::cout, and I saw my output :)
Upvotes: 1
Views: 1700
Reputation: 4939
Posting @Jonathan comment as the answer.
One thought might be that the window disappears too quick to see something. Try putting sleep(5); after your cout statement
Upvotes: 1