Eclipse 找不到 MinGW。为什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20024817/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:21:03  来源:igfitidea点击:

Eclipse can't find MinGW. Why?

eclipsemingw

提问by László Szerémi

I installed both correctly, but it doesn't matter if I set up the path to compiler correctly or not because it can't find gcc and g++. I checked it with explorer, they were at the correct location. I tried everything I could, even I ran Eclipse in backwards compatibility mode and as an administrator.

我都正确安装了,但是我是否正确设置了编译器的路径并不重要,因为它找不到 gcc 和 g++。我用资源管理器检查过,他们在正确的位置。我尽我所能,即使我以向后兼容模式和管理员身份运行 Eclipse。

EDIT: I'll using Visual Studio 2012 for a while if Eclipse can't be at least as user friendly to having find a solution to the problem under one hour via web.

编辑:我将使用 Visual Studio 2012 一段时间,如果 Eclipse 不能至少像用户友好的那样在一个小时内通过网络找到问题的解决方案。

回答by URL87

Download this, chose the desired compilers (gcc and g++) . Make sure you have the value C:\mingw64in PATHvariable under environment variables.

下载这个,选择所需的编译器(gcc 和 g++)。确保你C:\mingw64PATH变量下有值environment variables

回答by Brian Richer

I had to reload my workspace in order to get Eclipse to recognize that.

我必须重新加载我的工作区才能让 Eclipse 识别出来。

Also, I had updated the Path variable.

另外,我更新了 Path 变量。

Please follow the same in your case.

请按照您的情况进行操作。

回答by iloo

I couldn't make the Eclipse (LUNA) to find MinGW on my computer (there were no MinGW available in Preferences>C/C++/New C/C++ Project Wizard) even after I have specified PATH as "C:\MinGW\bin" in Preferences>C/C++/Build>Environment, so what I did afterwards was:

我不能让在Eclipse(LUNA)找到MinGW的我的电脑上(没有MinGW的可用首选项> C / C ++ /新的C / C ++项目向导),即使我已经指定的路径为“C:\ MinGW的\ BIN " 在Preferences>C/C++/Build>Environment 中,所以我之后做的是:

  1. Create a simple "Hello world" C project without specifying any toolchains
  2. (at this step I tried to Build All, and it failed)
  3. Go to Project>Properties, suprisingly, here I could see MinGW GCC as an available choice for Current toolchain. Select it.
  4. Now I could build and run the project
  1. 创建一个简单的“Hello world”C 项目而不指定任何工具链
  2. (在这一步我尝试构建所有,但失败了)
  3. 转到Project>Properties,令人惊讶的是,在这里我可以看到 MinGW GCC 作为当前工具链的可用选择。选择它。
  4. 现在我可以构建和运行项目

Hopefully, it helps!

希望它有帮助!