4

I recently configured Eclipse CDT for C++ development. I can build projects and no errors show up in the project.

When I try to run the project I get an error that states: lunch failed, No binaries found. This is the basic hello word C++ project that I created using the Eeclipse option menu FileNewC++ ProjectExecutableHello world C++ Project.

I tried following this solution. It had no effect.

I tried cleaning the project and building the project multiple times.

I set up CDT with Eclipse v4.2 (Juno) on my other computer with without any problems.

I had previous problems configuring Eclipse which I don't think are related, but details can be found here.

So the EXE file is in the debug folder, but for some reason Eclipse refuses to run it. It's like it does not see the EXE file. How can I fix this?

Update

I have looked at the other projects that execute successfully and noticed that there is a binaries folder in them that does not exist in the projects that don't work. (Even in the projects that don't work I can launch the EXE file manually by going to the debug folder which contains the EXE file after build).

This means that for some reason Eclipse is not creating the binaries folder with the EXE file. I tried creating the folder manually and placing the EXE file in it, but the folder has a special look when eclipse creates it and it doesn't work when you just create the folder manually. The folder just seem to contain the same file as the debug folder.

This is really frustrating.

4

7 回答 7

4

您是否在 Project Explorer 中的“二进制”虚拟文件夹下看到该文件?

看起来您的“二进制解析器”没有选择可执行文件。您使用 CDT 生成的 makefile 还是您自己编写的?还要检查在打开项目属性时是否选择了“PE Windows Parser”和/或“Cygwin PE Parser”,导航到“C/C++ Build”/Settings 页面和“Binary Parsers”选项卡。

于 2013-05-03T20:27:18.403 回答
2

我刚刚遇到了同样的错误,这就是我所做的:

必须选择正确的二进制解析器,这样 Eclipse 才能识别可执行文件: 选择项目,然后右键单击。

Project->Properties->C/C++ Build->Settings->Binary Parsers, PE Windows Parser(或者如果你使用那个编译器,你可以选择 Cygwin)。

至少对于交叉编译器来说,这对我有用。

在 Linux 中,我使用 Elf 解析器。

于 2013-06-10T12:16:35.430 回答
1

我有同样的问题。它只是通过保存我的 .c 文件来解决!仅在我的 .c 文件中单击Ctrl+S即可解决问题。我认为原因是程序没有构建任何东西!现在它生成 Binaries 文件夹并且工作正常!

于 2018-08-28T15:37:25.977 回答
0

日食火星 + CDT。视窗 7 64 位。这可能是旧的,但是如果一些新人坚持这个问题 - 我的是 as.exe 以某种方式损坏,所以它无法启动因此没有从 *.s 文件中生成 *.o 文件,随后 ld 有无事可做,因为没有 *.o 文件,并且随后没有 *.exe。所以它看起来像它构建但没有可执行文件因此而创建。我通过简单地下载最新的 MinGW 二进制工具并覆盖所有 /bin 和 /mingw32 文件来修复它。

于 2016-05-20T09:16:59.437 回答
0

您必须使用Ctrl+B来构建项目。它会自动为您创建二进制文件。

于 2019-11-05T17:09:52.940 回答
-1

如果您是第一次使用 Eclipse for C++,则必须在运行程序之前构建程序。要构建项目,菜单ProjectBuild the project,然后运行我想这样就可以了。

于 2017-01-17T18:08:58.743 回答
-1

安装 Eclipse 时,我选择仅使用 MinGW 进行设置。一旦我想开始一个新项目,没有 MinGW 选项,我创建了一个项目,但问题标题也遇到了同样的问题。我将Properties> C/C++ Build>更改Tool Chain EditorMinGW GCC 稍后。这解决了我的问题。

于 2017-07-18T15:48:49.060 回答