User forums > Using Code::Blocks
How to open a console window in debug mode.
josue:
Hi,
I have just installed CB and it is running fine. I have also installed GDB and is is working OK, as well.
Now that I am debuging my programs I want to see the progress (output) of them on a console window, under Linux.
For instance, I have a line like this: printf ("Hello world.");
How can I force CB, in debug mode, to open a console window to see that output (Hello World) on the screen?
Note: I set the program as a console aplication.
Thanks for any help.
Regards,
Josué
[/color]
Jenna:
If you set your build target type to console application you should always get an output window.
If you use the wizard to create a console application, the settings are made automatically, if you started with an empty project, it should also be there.
Whatsoever:
Right-click on your project in the management pane and chose "Properties... -> Build targets".
Make sure the type is set to "Console application" and check "Pause when execution ends", or the console closes immediately after the application ends.
josue:
Hi Jens,
Thanks for your reply!
Yes, I did everytheng you suggested. My build target seems to be ok. (console application)
But the outpu window still did not appear.
Please find attached a screenshot for more details.
Thanks for the help.
Regards,
Josué
[attachment deleted by admin]
ollydbg:
It is easy to create a console project using wizard.
If you want to change your target , see the attachment picture.
Property->build targets
[attachment deleted by admin]
josue:
Hi ollydbg,
Thanks for your reply!
I am new in Linux and this is the first time I am using CodeBlocks, so I have very basic doubts.
I have done as you suggest in the first time I created the project.
I have been thinking about this problem the last 7 days and found the solution some minutes ago.
I just needed to install a program called "xterm".
I notice in Settings->Enviroment a setting like this:
Terminal to launch console programs: xterm -T $TITLE -e
So I tried to run the xterm program in a Konsole Terminal but the system did no found it.
Then I installed xterm in my computer and now I can see the output of my console program in a console window.
That's great!
Maybe this is the solution for many people that have this problem.
Best regards for You and for Jens for the attention.
Merry Christmas and Happy New Year for all of you!
Josué
Navigation
[0] Message Index
[#] Next page
Go to full version