Page 1 of 1

No Console Window in GUI Project

Posted: Wed Aug 19, 2015 8:57 pm
by evstevemd
I need to see Outputs like I see in xterm in Linux. In Windows it shows only Window with GDB.exe as current command and printing a cout statement yield nothing. Is this a bug?
I saw this in CL 8.1 and it here in 8.2

Also where did the old option to see output in CL itself go?

Re: No Console Window in GUI Project

Posted: Wed Aug 19, 2015 10:26 pm
by eranif
On Windows, a "Window" application does not have a terminal attached to it.
You can remove the flag "-mwindows" from the linker and it will open a console, but I am not sure that "printf" will go to it
evstevemd wrote:Also where did the old option to see output in CL itself go?
I am not familiar with this

Eran

Re: No Console Window in GUI Project

Posted: Wed Aug 19, 2015 10:58 pm
by evstevemd
eranif wrote:On Windows, a "Window" application does not have a terminal attached to it.
You can remove the flag "-mwindows" from the linker and it will open a console, but I am not sure that "printf" will go to it
I can see that but it cannot send printf/cout/wxPuts.

So where does Output go?
eranif wrote:
evstevemd wrote:Also where did the old option to see output in CL itself go?
I am not familiar with this
Eran
In Old CL we could see standard output (like cout/wxPuts) in some Window in Debugging mode. I don't remember which CL had it before it disappeared.

Re: No Console Window in GUI Project

Posted: Wed Aug 19, 2015 11:05 pm
by eranif
evstevemd wrote:I can see that but it cannot send printf/cout/wxPuts.
This is Windows specific, you will need to read about OutputDebugString or something like that, I am not sure
evstevemd wrote:In Old CL we could see standard output (like cout/wxPuts) in some Window in Debugging mode. I don't remember which CL had it before it disappeared.
Recent CodeLItes (several versions now) are only using the native OS terminal, there is no more embedded terminal-alike in CodeLite

Eran

Re: No Console Window in GUI Project

Posted: Thu Aug 20, 2015 12:07 am
by evstevemd
thank you!

Re: No Console Window in GUI Project

Posted: Fri Oct 23, 2015 6:59 am
by Syke
eranif wrote:Recent CodeLItes (several versions now) are only using the native OS terminal, there is no more embedded terminal-alike in CodeLite
Eran
The old console (in CodeLite window) was nice in that the runtime output stayed around after debugging exited. Is there any way to have the OS terminal stick around after exiting debugging so that the text can be read/copied?

Re: No Console Window in GUI Project

Posted: Sun Oct 25, 2015 2:52 pm
by Modem Man
Is there any way to have the OS terminal stick around after exiting debugging so that the text can be read/copied?
not very very smart, but actually works for me:

Code: Select all

#include <iostream>
using namespace std;

int main(int argc, char **argv)
{
  int res = 0;
  cout << "Hello staying text console" << endl;
  cin.ignore(); // wait for input, but not read it
  return res;
}
of with non-stream functions:

Code: Select all

#include <stdio.h>
#include <stdlib.h>

int _tmain(int argc, char **argv)
{
  int res = 0;
  _tprintf("Hello staying text console\n");
  _gettchar(); // wait for input, but not read it
  return res;
}
Does it help?
MM

Re: No Console Window in GUI Project

Posted: Sat Oct 31, 2015 8:50 pm
by Syke
That helps a little, but it only works if you can run to end-of-program. When debugging, if any sort of crash condition is reached, that hack won't help.