Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: jeroglifo on May 13, 2020, 07:20:58 pm

Title: Console debug output with wxWidgets in debian gnu/linux
Post by: jeroglifo on May 13, 2020, 07:20:58 pm
Hi,
Beginner question:
Please, somebody so kind to show me how can I print debug info with cout << to a debug console? Naturally, the GUI musst run at the same time.

In other words, I would like to display a debug text in a console when I click a button.

Thanks in advance.
Title: Re: Console debug output with wxWidgets
Post by: oBFusCATed on May 13, 2020, 07:43:10 pm
You're probably on windows. To do so you need to switch the type of the application to console or you need to show a console manually and also attach the std streams to the console. There are plenty of places where this is explained on the internet. You can start by searching for AttachConsole.

If you're not on Windows, then you can just print to the console. Then switch the app type to console and enable the pause for exit checkbox.
Title: Re: Console debug output with wxWidgets
Post by: jeroglifo on May 13, 2020, 08:40:43 pm
Hi Obfuscated. First place, thank you very much.

I am on Debian.

I can't find an example, perhaps, if somebody could attatch one... (I'm lost no idea, if I write a terminal program, the output is through xterm, but that's not the case)

Thanks in advance
Title: Re: Console debug output with wxWidgets in debian gnu/linux
Post by: oBFusCATed on May 13, 2020, 08:50:38 pm
Switch the project type to console and there is a pause checkbox under the type combobox. Project -> Properties -> Build targets -> your build target