Hi,
I would like to know how do I check what was printed with a std::cout in a GUI (wx) during development.
I can't find any output window/view.
I only see output if I run the app outside C::B via CLI.
Thanks.
Set the type of your project to console and it will show you the output :)
That didn't work. The output window appears, but nothing is printed.
Quote from: Otto on September 25, 2010, 02:31:46 AM
That didn't work. The output window appears, but nothing is printed.
I just tested it (on linux) and it works fine.
Hm, if you're on windows you should read here: http://msdn.microsoft.com/en-us/library/ms682073%28VS.85%29.aspx
You need AttachConsole + a way to redirect stdout/stdin to the console... let google be your friend...
Quote from: oBFusCATed on September 25, 2010, 10:58:04 AM
Hm, if you're on windows you should read here: http://msdn.microsoft.com/en-us/library/ms682073%28VS.85%29.aspx
You need AttachConsole + a way to redirect stdout/stdin to the console... let google be your friend...
Tested on Vista and it works out of the box.
I'm using Linux (Debian) and C::B 10.05.
I tested again and noticed it is only printed after I quit the program. I wasn't seeing because the output window is closed at that moment too. Have to keep "Pause when execution ends" checked.
Can't it be printed as soon as std::cout is called?
Tested again on linux (stepped through the code with debugger) and the output appears immediately after stepping over cout.
That's nice, but it doesn't work for me. Is there anything I can do?
Ps: you're testing in a GUI (configured later to console) app, right? The cout is called when I do a GUI action (Menu help > about).
Tested it and it works on Windows 6.1 AKA 7
Note: Flush was necessary to see output
std::cout << "Test Message" << std::flush;
Remember to change project properties for target to "Console Application" and checkmark "Pause when Execution Ends"
Tim S
Quote from: stahta01 on September 25, 2010, 06:15:12 PM
Note: Flush was necessary to see output
std::cout << "Test Message" << std::flush;
That was it! Thanks.
Sorry everyone, I'm new to C++.
I used std::endl as last argument and that also seems to flush.
I confirm endl is enough.