Author Topic: Capture output from Tools command line  (Read 4771 times)

drenfroe

  • Guest
Capture output from Tools command line
« on: January 29, 2006, 11:05:03 pm »
I'm pretty new to Code::Blocks, but I haven't found a way to capture the output from a custom tool I've defined.
I'm using the Winavr distribution of the Avr-gcc compiler and everything works great, except that I only get a very brief glimpse at the messages output by the compiler before the Dos box closes.
I think there is a way to add something to the batch file that calls the compiler to keep the window open, but I thought there would be a way to redirect the output to the messages window in C::B.

BTW, I really like what I've seen from this project. Thanks a bunch to the dev team!

David

nicolas

  • Guest
Re: Capture output from Tools command line
« Reply #1 on: April 10, 2006, 04:29:31 pm »
Hello,

I am also interested by an answer as I am trying to do the same thing. I would like to redirect output of a tool to the Code::Blocks window.

Thanks in advance,

Nicolas

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Capture output from Tools command line
« Reply #2 on: April 10, 2006, 04:36:37 pm »
As far as the compiler is concerned : you can plug-in your compiler into the framework. In the compiler settings, copy for example the GCC one, and adjust the programs and settings to what your compiler uses.

To capture the output of a program, what you could do is :
 - turn your program into a plug-in ( a plug-in wrapping your program)
 - call the 'core' program by using wxExecute, and dump the output/error on a list.

For a working example, browe the forum or the wiki for my clearcase plug-in, in there I am using such an approach.

Cheers,
Lieven

Offline chikigai

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Capture output from Tools command line
« Reply #3 on: April 11, 2006, 03:19:51 am »
I've searched the forums and wiki, but haven't been able to find any links to the latest version of the clearcase plug-in.
Can you provide a link?

Cheers,
Daniel
[Development Environment]
OS: WinXP SP3
IDE: Code::Blocks Nightly Build SVN Rev.6080 wxWidgets: 2.8.10 Windows Unicode Build SVN: 1.6.x

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Capture output from Tools command line
« Reply #4 on: April 11, 2006, 08:22:32 am »
Attached is the latest version, focus on the clearcase.cpp file.


[attachment deleted by admin]

Offline chikigai

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Capture output from Tools command line
« Reply #5 on: April 11, 2006, 08:45:02 am »
Thanks a bunch!

Cheers,
Daniel
[Development Environment]
OS: WinXP SP3
IDE: Code::Blocks Nightly Build SVN Rev.6080 wxWidgets: 2.8.10 Windows Unicode Build SVN: 1.6.x