Eclipse CDT Debug控制台不显示程序输出

时间:2023-02-05 11:59:42

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.

我在Windows XP上使用Eclipse IDE for C / C ++ Developers(Eclipse Ganymede Package - 版本3.4.2),MinGW GCC 4.2.1和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.

我面临的问题与此处提到的问题非常相似。一个简单的hello world程序不会打印到调试器中的控制台输出。运行命令正确显示输出。我检查了gdb输出控制台和输出控制台。

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

在eclipse的控制台窗口中获取输出的正确设置是什么?

1 个解决方案

#1


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

//你把endl放在输出的末尾吗?

int main()
{
    cout << "!!!Hello World!!!"; // prints nothing to console ; no endl
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! twice
    return 0;
}

#1


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

//你把endl放在输出的末尾吗?

int main()
{
    cout << "!!!Hello World!!!"; // prints nothing to console ; no endl
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! twice
    return 0;
}