Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: drenfroe on January 29, 2006, 11:05:03 pm

Title: Capture output from Tools command line
Post by: drenfroe 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
Title: Re: Capture output from Tools command line
Post by: nicolas 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
Title: Re: Capture output from Tools command line
Post by: killerbot 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
Title: Re: Capture output from Tools command line
Post by: chikigai 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
Title: Re: Capture output from Tools command line
Post by: killerbot on April 11, 2006, 08:22:32 am
Attached is the latest version, focus on the clearcase.cpp file.


[attachment deleted by admin]
Title: Re: Capture output from Tools command line
Post by: chikigai on April 11, 2006, 08:45:02 am
Thanks a bunch!

Cheers,
Daniel