I'm developing a gcc application using Visual Studio 2015 as an IDE. The debugger is gdb.
The application creates it's own window. When I compile with a DEBUG switch, I need the application to also spawn a console window. It's used for debugging and outputing printf's from multiple threads. Thanks to the "-mwindows" switch, this works correctly when I execute the application from outside Visual Studio.
Unfortunately, when I run the application from within Visual Studio, it seem to steal the console window. No console is spawned, and the printf's output are redirected to the Output Debug window.
This wouldn't be much of a problem if the VS console actually printed the "\n" correctly instead of stripping them out of the ouput. Everything gets printed on the same line, and the output becomes unreadable. Try as I may, I couldn't get VS to insert a newline in the Output Debug window. I searched online a lot, and this problem seems to be well documented, but I couldn't find a satisfying answer.
At this point, either of these solutions would work for me :
EDIT : Ideally, the solution should be cross-plateform, in a sense that it should not add dependency to WinAPI.
EDIT2 : "\t" seems to work as intended. Why does "\n" doesn't work? I also tried "\r\n" to no avail.
I was contacted by a Senior PM Manager for Visual Studio at Microsoft regarding this issue. I posted it as a "feedback" inside Visual Studio, about four months ago (around the time I posted it here)..
He acknowledged the problem, and said they're gonna try to add support for external consoles with Update 3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With