简体   繁体   中英

Console output in a window application (Visual Studio 2015, C++, SDL2)

I'm trying to do a few simple std::couts for debugging but because it's a window application I'm not seeing the console where the outputs would be. How do I set up visual studio so that I can see outputs to the console while running a window application?

Cheers!

Rather than answer the specific question, I'll answer with one common practice mechanism for debugging Windows GUI applications which is to use the TRACE macro. When debugging it'll end up in the Visual Studio Output window. You can also attach other viewers. See this: https://msdn.microsoft.com/en-us/library/7sx52ww7(v=vs.140).aspx

I use OutputDebugStringA() to output to the console window in the IDE.

You should search the MSDN site for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM