6

I am using Eclipse IDE for C/C++ Developers (Eclipse Ganymede Package - version 3.4.2) on Windows XP with MinGW GCC 4.2.1 and GDB 6.8-3.

I am facing a problem very similar to that mentioned here. A simple hello world program will not print to the console output in the debugger. A run command displays the output correctly. I have checked both gdb output console and the output console.

What are the right settings to get the output in console window of eclipse?

bhadra
  • 12,887
  • 10
  • 54
  • 47

1 Answers1

2

//have you put endl at the end of your output?

int main()
{
    cout << "!!!Hello World!!!"; // prints nothing to console ; no endl
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! twice
    return 0;
}
phimuemue
  • 34,669
  • 9
  • 84
  • 115
  • 1
    Adding the endl flush worked for me but there is a lot of discussion around this and I am not sure if this always works. It is worth looking at the related windows issues (which seems to be tied to a 32 vs 64 bit environment problem): http://www.eclipse.org/forums/index.php?t=msg&th=197552&start=0&S=2a2b64e1f1404705c0214976bd477428 – Mick Nov 26 '10 at 14:59