This topic has been started before but I did not see a useful completion. Threads are e.g.
http://forums.codeblocks.org/index.php/topic,13175.msg88504.html#msg88504http://forums.codeblocks.org/index.php/topic,17413.msg119538.html#msg119538Basically this describes what I was looking for.
[Quote from: MortenMacFly on August 25, 2010, 07:12:47 am]
Is there a way to display the printed output from a console application in a text area in the codeblocks IDE?
You can use the "Tools" menu to create an entry that calls your application (using macros to make it more generic) and then pipe the output to the C::B log.
[/Quote]
Since the original thread is locked please allow me here to come back to it.
I actually tried out that proposal and met some issues. Here is what I did.
Tools/Configure/Add
Name: Run and send cout to CodeBlocks Tab
Exec: $(TARGET_OUTPUT_BASENAME)
Params: empty
WorkingDir: $(TARGET_PROJECT_DIR)
LaunchOptions: LaunchTool hidden with standard output redirected
Now I have a new menu entry: Tools/Run and send cout to CodeBlocks Tab. When I open the menu and select the new enty, my Application starts and I see its log outputs in the console window. Wonderful!
Unfortunately there are some issues:
- I could not set up my execution directory, at least I do not know what Macro to use. How can I find out
wether or not there is a macro for that?
- After I tried to set it manually I kind of corruped it. Despite C::B restart and removing and adding it again I can not
get it to run any more. I observe in the Edit Tool window, that all macro names are missing their "_", i.e.
$(PROJECT_OUTPUT_BASENAME) now is listed as $(PROJECTOUTPUTBASENAME). Neither works any more.
I get the error message "Couldn't execute tool. Check out the log for details."
I tried Tools+/ToolOutputWindow, CodeBlocks console, Project directory and CodeBlocks directory but could not find a log.
The console gives me just the info launching tool...
- I could assing a hotkey to it, e.g. F6 which is not assigned as default. With thats its rather good to use. Using the
menu only would imho not an acceptable usability for such a frequently used command.
- I can not see a way implement "Build and Run" with that
- I can not see a way implement "Abort" with that, as we do not have the PID
- I can not see a way to get the Run button assigned that function.
- Any way to start debug with output
So principally technically easy to do and highly recommended to use, if
- the Project exec dir is available
- there is a workaround for that issue that broke it for me..
I am wondering what was the rationale not to provide this as build in behaviour of Run/Build&Run and Debug?