eclipse 项目建立。但它不会创建二进制文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16328473/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Project builds. Yet it doesn't create the binaries folder
提问by Xitcod13
I recently configured Eclipse CDT for C++ development. I can build projects and no errors show up in the project.
我最近为 C++ 开发配置了 Eclipse CDT。我可以构建项目并且项目中没有出现错误。
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 File→ New→ C++ Project→ Executable→ Hello world C++ Project.
当我尝试运行该项目时,我收到一条错误消息:午餐失败,未找到二进制文件。这是我使用 Eeclipse 选项菜单File→ New→ C++ Project→ Executable→ Hello world C++ Project创建的基本 hello word C++ 项目。
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.
我在另一台计算机上使用 Eclipse v4.2 (Juno) 设置 CDT,没有任何问题。
I had previous problems configuring Eclipse which I don't think are related, but details can be found here.
我以前在配置 Eclipse 时遇到过我认为无关的问题,但可以在此处找到详细信息。
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?
所以 EXE 文件在 debug 文件夹中,但由于某种原因 Eclipse 拒绝运行它。它就像没有看到EXE文件。我怎样才能解决这个问题?
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).
我查看了其他成功执行的项目,并注意到其中有一个二进制文件夹,但在不起作用的项目中不存在。(即使在不起作用的项目中,我也可以通过在构建后转到包含 EXE 文件的调试文件夹来手动启动 EXE 文件)。
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.
这意味着出于某种原因,Eclipse 没有使用 EXE 文件创建二进制文件夹。我尝试手动创建文件夹并将 EXE 文件放入其中,但是当 eclipse 创建它时该文件夹具有特殊的外观,并且当您手动创建文件夹时它不起作用。该文件夹似乎包含与调试文件夹相同的文件。
This is really frustrating.
这真的很令人沮丧。
采纳答案by Eugene
Do you see the file under "binaries" virtual folder in your Project Explorer?
您是否在 Project Explorer 中的“binaries”虚拟文件夹下看到了该文件?
It looks like you "binary parser" is not picking the executable. Do you use CDT-generated makefile or the one you wrote yourself? Also check if "PE Windows Parser" and/or "Cygwin PE Parser" are selected when you open project properties, navigate to "C/C++ Build"/Settings page and "Binary Parsers" tab.
看起来您的“二进制解析器”没有选择可执行文件。您使用 CDT 生成的 makefile 还是您自己编写的 makefile?还要检查打开项目属性时是否选择了“PE Windows Parser”和/或“Cygwin PE Parser”,导航到“C/C++ Build”/Settings 页面和“Binary Parsers”选项卡。
回答by Nenad Bulatovic
I just had the same error, and here is what I did:
我刚刚遇到了同样的错误,这是我所做的:
Proper binary parser must be selected so Eclipse can recognize the executable: Select the project, then right click.
必须选择正确的二进制解析器,以便 Eclipse 能够识别可执行文件:选择项目,然后右键单击。
Project->Properties->C/C++ Build->Settings->Binary Parsers, PE Windows Parser (or you can select Cygwin if you use that compiler).
Project->Properties->C/C++ Build->Settings->Binary Parsers、PE Windows Parser(或者,如果您使用该编译器,则可以选择 Cygwin)。
That worked for me at least for Cross compiler.
这至少对交叉编译器对我有用。
In Linux I use Elf parser.
在 Linux 中,我使用 Elf 解析器。
回答by Gamal Othman
I had the same problem. It's just solved by saving my .c file! Only clicking Ctrl+Sin my .c file and the problem solved. I think the reason was the program was building nothing! Now it generates Binaries folder and works fine!
我有同样的问题。它只是通过保存我的 .c 文件来解决的!仅在我的 .c 文件中单击Ctrl+S 即可解决问题。我认为原因是该程序没有构建任何内容!现在它生成 Binaries 文件夹并且工作正常!
回答by Srikanth Pendem
You have to use Ctrl+Bto build the project. It automatically creates the binaries for you.
您必须使用Ctrl+B来构建项目。它会自动为您创建二进制文件。
回答by WhiteTiger
Eclipse Mars + CDT. Windows 7 64bit. This might be old, however if some new guy stuck on this problem - mine was that as.exe was somehow corrupted, so it failed to launch thus didn't produce *.o file out of *.s file, and followingly ld had nothing to do because of there is no *.o file, and followinglly no *.exe. So it looks like it builds but no executable creates because of this. I fixed it by simply downloading latest MinGW binary tools, and overwriting all the /bin and /mingw32 files.
日食火星 + CDT。视窗 7 64 位。这可能是旧的,但是如果有一些新人坚持这个问题 - 我的是 as.exe 以某种方式损坏,所以它无法启动,因此没有从 *.s 文件中生成 *.o 文件,随后 ld 有因为没有 *.o 文件,所以无事可做,随后也没有 *.exe。所以它看起来像它构建但没有可执行文件因此而创建。我通过简单地下载最新的 MinGW 二进制工具并覆盖所有 /bin 和 /mingw32 文件来修复它。
回答by jaya rayee
If you're using Eclipse for C++ for the first time, you have to build the program before you run the program. To build the project, menu Project→ Buildthe project, and then run I think this will do it.
如果您是第一次使用 Eclipse for C++,则必须在运行程序之前构建程序。要构建项目,菜单Project→ Buildthe project,然后运行我认为这样就可以了。
回答by thyship
When installing the eclipse I chose to setup with only MinGW. Once I wanted to start a new project, there was no MinGW option, I created a project and I got the same problem with the question title. I changed the Properties
> C/C++ Build
> Tool Chain Editor
to MinGW GCC
later on. This solved my problem.
安装 eclipse 时,我选择仅使用 MinGW 进行设置。一旦我想开始一个新项目,就没有 MinGW 选项,我创建了一个项目,但问题标题出现了同样的问题。我将Properties
> C/C++ Build
>更改Tool Chain Editor
为MinGW GCC
稍后。这解决了我的问题。