Seeing output in MSW

General questions regarding the usage of CodeLite
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Seeing output in MSW

Post by iwbnwif »

Sorry for a very basic question, but I cannot find how to see my program's output under MSW.

In Linux either xterm opens when I run the program or a degguging window opens if I am debugging. In both cases std::cout goes to a window.

But I don't get either of these in MSW and despite a googling a wide range of keywords, surprisingly nothing turns up with the answer.

Thanks for helping!
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Seeing output in MSW

Post by eranif »

Are you writing a GUI application or console?

Eran
Make sure you have read the HOW TO POST thread
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Seeing output in MSW

Post by iwbnwif »

Sorry I should have made that clear, its a GUI
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Seeing output in MSW

Post by eranif »

IIRC, under Windows, GUI applications are created without a console attached

If you are using wxWidgets, use wxLogMessage and set up a log window for this

http://docs.wxwidgets.org/2.9.4/group__ ... gging.html
Eran
Make sure you have read the HOW TO POST thread
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Seeing output in MSW

Post by iwbnwif »

So there is no CL debugging output window under MSW the same way as there is in Linux?
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Seeing output in MSW

Post by eranif »

No, its up to your code to provide it

Eran
Make sure you have read the HOW TO POST thread
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Seeing output in MSW

Post by iwbnwif »

Thank you for taking the time to explain this.

I would like to add this as a feature request, actually it would be really nice to have a window in the IDE for both Windows and Linux where std::cout can be seen rather than a pop-up terminal (Linux) and /or having to implement a wxLogWindow (Linux and Windows).

Do you mind if I add this as a feature request?
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Seeing output in MSW

Post by eranif »

Like I said: its up to your application to create such window , codelite can't do that for you.

Eran
Make sure you have read the HOW TO POST thread
petah
CodeLite Expert
Posts: 231
Joined: Sat Nov 24, 2012 8:04 pm
Genuine User: Yes
IDE Question: c++
Location: Los Angeles
Contact:

Re: Seeing output in MSW

Post by petah »

On Linux all you need to see logs in CL's debugger pane is:

Code: Select all

new wxLogChain(new wxLogStderr(stdout))
if it doesn't work as is on Windows see MSDN docs around ::OutputDebugString(). If your app isn't wx-based, copy the part of wxLog code you need to replicate it.

cheers,

-- p
main: Debian Jessie x64 + custom wxTrunk
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Seeing output in MSW

Post by iwbnwif »

Thank you for your replies.

The problem with the following is that in MSW stdout doesn't appear to go anywhere (under Windows 8 at least).

Code: Select all

new wxLogChain(new wxLogStderr(stdout))
see MSDN docs around ::OutputDebugString()
Thank you for this tip. I tried this but also the output seems to go nowhere, even if I set debugevents as it suggests in the gdb manual.

So I think the only way is (as Eran suggested) to create a wxLogWindow.

Code: Select all

wxLogWindow *w= new wxLogWindow(this, wxT("Logger"));
w->Show();
Just a thought, but personally I would like all stdout to go to the "Output" tab of the "Output View" pane :)
Post Reply