使用 MinGW 的 Eclipse CDT 不在控制台中输出

2022-01-11 00:00:00 console mingw eclipse eclipse-cdt

我有一台 Windows 7 64 位 PC,我正在尝试安装免费的 C++ IDE,因此我选择使用 CDT 安装 Eclipse Helios.

I have a Windows 7 64-bit PC and I am trying to install a free C++ IDE, so I chose to install Eclipse Helios with CDT.

对于 g++、make 和 gdb,我根据本教程安装了 msys 和 mingw:http://wiki.wxwidgets.org/HowTo:_Install_MSYS_and_MinGW_for_use_with_Eclipse_CDT

For g++, make and gdb I installed msys and mingw according to this tutorial: http://wiki.wxwidgets.org/HowTo:_Install_MSYS_and_MinGW_for_use_with_Eclipse_CDT

版本是:

  • 制作:GNU make 3.81
  • g++:4.5.0
  • gdb:7.1

所以它应该与我的 64 位 CPU 兼容.

So it should be compatible with my 64-bit CPU.

但是,当我尝试使用 eclipse 运行一个非常简单的程序时,我在控制台上什么也看不到.源代码为:

However when I try to run a very simple program with eclipse, I see nothing on the console. The source code is:

#include <iostream>

 using namespace std;

 int main()
 {
    int i;

    cout << "Enter an integer: " << endl;
    cin >> i;
    cout << endl << "i is " << i << endl;

    return 0;
 }

构建很好,当我使用命令(Windows 控制台)启动 .exe 时,行为符合预期.但是使用 Eclipse 控制台,我看不到运行和调试的输出只是:输入一个整数:",然后当我输入一个数字并按 Enter 时,它什么也不做.

The build is fine and when I launch the .exe with command (windows console) the behavior is as expected. But with the Eclipse console I see nothing with run and with debug the output is just: "Enter an integer: ", then when I type in a number and hit enter it does nothing.

请问有人知道怎么解决吗?

Does anyone know how to fix this please?

谢谢,

纪尧姆

PS:我使用工具链Linux GCC",而MinGW GCC"在控制台中什么都没有.

PS: I use the toolchain "Linux GCC", with "MinGW GCC" I have nothing at all in the console.

推荐答案

在 64 位版本的 eclipse 中已经发现了这个控制台错误:

This console bug has been noticed in 64-bit versions of eclipse:

http://www.eclipse.org/forums/index.php?t=msg&th=197552&start=0&S=2a2b64e1f1404705c0214976bd477428

解决方法是安装 32 位 eclipse

A workaround is to install the 32-bit eclipse

相关文章