执行格式错误 Eclipse CDT

Exec Format Error Eclipse CDT

我在 Eclipse 中有一个基本的 C++ 程序 CDT:

#include <iostream>
using namespace std;

int main()
{
  std::cout << "Hello World!";
}

但是,当我尝试构建它时,出现执行格式错误。这是编译器产生的输出

g++ -O0 -g3 -Wall -c -fmessage-length=0 -o hey.o "..\hey.cpp" 
g++: error: spawn: Exec format error

我正在使用 MinGW 工具链。我使用的是 64 位 Windows,我认为这可能与此有关。谁知道如何得到这个程序运行?

编辑 运行 我的源文件所在目录的命令提示符中的确切命令工作正常,没有抛出错误,但它在 Eclipse 中仍然不起作用

因此,我通过安装 64 位版本的 MinGW (http://sourceforge.net/projects/mingw-w64/) 自行解决了这个问题。它现在编译和构建 noramlly