1

I tried using freopen() to redirect the "cout" function to the console, but it doesn't produce the desired effect. Instead of just double clicking on the executable and having the console show it's message, I need to use a command prompt or a batch file, and that's a problem, because I want the user to be able to close the console after the message has been displayed without closing the SDL window. This is supposed to be a console application. I apologize if I am not clear enough.

4

1 回答 1

0

如果使用 freopen() 不起作用,SDL 控制台常见问题解答提供了一个关于重新编译 SDLmain 库的教程,该教程相对容易理解,特别是如果您已经安装了 MSYS 和 MinGW。您可以使用生成的 SDLmain 库而不是当前的库,它应该可以工作(它适用于我的项目)。

于 2013-02-01T00:44:40.267 回答