eclipse 使Eclipse生成C++可执行文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12936792/
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
Make Eclipse generate C++ executable file
提问by Vittorio Romeo
Using latest MinGW and C++ Eclipse.
使用最新的 MinGW 和 C++ Eclipse。
If I create an "Executable Hello World" project, build it and run it, everything works as expected.
如果我创建一个“可执行的 Hello World”项目,构建它并运行它,一切都会按预期进行。
If I create an "Executable Empty Project", then create a main.cpp file, build and run, I get the error message "Launch failed. Binary not found."
如果我创建一个“可执行的空项目”,然后创建一个 main.cpp 文件,构建并运行,我会收到错误消息“启动失败。找不到二进制文件。”
How can I make empty project generate binary files? I looked everywhere in the project properties but I must have missed it.
如何让空项目生成二进制文件?我在项目属性中到处查看,但我一定错过了。
回答by Bob
For me the solution was this:
对我来说,解决方案是这样的:
select your project and goto "project"-menu/properties (on mac).
选择您的项目并转到“项目”-菜单/属性(在 Mac 上)。
c/c++ Build/Settings.
c/c++ 构建/设置。
Binary parsers. now tick the one that suits your system (elf for linux, mach 64 for mac, pe for windows etc). the default is always elf and it reverts to it after every project, at least for me.
二进制解析器。现在勾选适合您系统的那个(elf for linux,mach 64 for mac,pe for windows 等)。默认值始终是 elf 并且在每个项目之后都会恢复为它,至少对我来说是这样。
回答by Schaki
On Eclipse Kepler (c++) with standard settings I today discovered that the error parser that creates the output in the "Problem" tab failed
在具有标准设置的 Eclipse Kepler (c++) 上,我今天发现在“问题”选项卡中创建输出的错误解析器失败
In the console there was an compile error from gcc, but it didn't show in the Problem tab, which is the one I look in the most. It was a type conversion error, very typical and nothing exotic, definitely something that should be included as an error.
在控制台中有一个来自 gcc 的编译错误,但它没有显示在问题选项卡中,这是我看到最多的一个。这是一个类型转换错误,非常典型,没有异国情调,绝对应该作为错误包含在内。
Hope it helps someone.
希望它可以帮助某人。