使用SDL时cout没有输出

时间:2014-05-26 10:12:01

标签: c++ sdl

对不起我的新手

使用SDL时有没有人在输出std :: cout时遇到问题?

即使我将SDL代码注释掉,我似乎也无法在输出中显示任何内容。

#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;
}

编辑:窗口关闭得太快,看不到任何东西,所以我添加了SDL_Delay(2000);在我的std :: cout之后,我看到了我的输出:)

1 个答案:

答案 0 :(得分:1)

发布@Jonathan评论作为答案。

一个想法可能是窗口消失太快而无法看到某些东西。试着睡觉(5);在您的cout声明之后