User forums > General (but related to Code::Blocks)

How to see output in a wxWidgets project?

<< < (2/3) > >>

Jenna:

--- 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...

--- End quote ---
Tested on Vista and it works out of the box.

Otto:
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?

Jenna:
Tested again on linux (stepped through the code with debugger) and the output appears immediately after stepping over cout.

Otto:
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).

stahta01:
Tested it and it works on Windows 6.1 AKA 7

Note: Flush was necessary to see output


--- Code: ---std::cout << "Test Message" << std::flush;

--- End code ---

Remember to change project properties for target to "Console Application" and checkmark "Pause when Execution Ends"

Tim S

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version