Eclipse CDT Debug console not displaying program output
Asked Answered
F

1

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?

Foxhound answered 20/5, 2009 at 14:25 Comment(0)
C
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;
}
Casa answered 20/9, 2009 at 7:55 Comment(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): eclipse.org/forums/…Rosemaryrosemond

© 2022 - 2024 — McMap. All rights reserved.