Windows 中的 Eclipse Ganymede 和 MinGW
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/871644/
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
Eclipse Ganymede and MinGW in Windows
提问by WhyNotHugo
I'm trying to get eclipse to work with MinGW. I've done the following:
我正在尝试让 Eclipse 与 MinGW 一起工作。我做了以下工作:
- Downloaded CDT for eclipse.
- Installed MinGW.
- Added C:\MinGW\bin to my path.
Opening a command prompt (CMD) and typing g++ or alike works fine. - I run eclipse, create a "New C++ Project", and only get the option saying "other toolchains".
- 为 Eclipse 下载了 CDT。
- 安装了 MinGW。
- 将 C:\MinGW\bin 添加到我的路径中。
打开命令提示符 (CMD) 并输入 g++ 或类似的命令可以正常工作。 - 我运行 eclipse,创建一个“新的 C++ 项目”,并且只得到“其他工具链”的选项。
There's a MILLIONtutorials out there saying eclipse should identify MinGW on its own. It doesn't, and I don't know what to do. I've tried reinstalling everying in just about every order posible. Still no luck.
有一百万个教程说 eclipse 应该自己识别 MinGW。它没有,我不知道该怎么办。我已经尝试以几乎所有可能的顺序重新安装所有东西。仍然没有运气。
I've also noted some tutorials say something about creating a "Managed C++ Project". I've no such option, all I get is "C++ Project" and "C Project"
我还注意到一些教程说一些关于创建“托管 C++ 项目”的内容。我没有这样的选择,我得到的只是“C++ 项目”和“C 项目”
edit:
I have eclipse ganymede, windows x86_64, version 3.4.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/index.php
编辑:我有 eclipse ganymede,windows x86_64,版本 3.4.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/index.php
Running the "Eclipse IDE for C/C++ developers" fails, since there's no x64 version for windows. The x86 version requires x86 JAVA installed as well, and installing two versions of java, gave nothing but trouble in the past.
运行“面向 C/C++ 开发人员的 Eclipse IDE”失败,因为 Windows 没有 x64 版本。x86版本也需要安装x86 JAVA,安装两个版本的java,过去就麻烦了。
采纳答案by JesperE
The distinction between managed make projects and makefile project was removed in CDT 4.x, I think. Now there is only one type of project, but you can select different builders. CDT includes an internal builder which does not use makefiles and another one which does.
我认为 CDT 4.x 中删除了托管 make 项目和 makefile 项目之间的区别。现在只有一种类型的项目,但您可以选择不同的构建器。CDT 包括一个不使用 makefile 的内部构建器和另一个使用 makefile 的构建器。
First, save yourself the effort of "reinstalling in every order possible". That is also known as trial-and-error, and will only make you more frustrated. Apply the normal problem-solving skills you have as a programmer.
首先,省去“按可能的顺序重新安装”的努力。这也称为反复试验,只会让您更加沮丧。应用您作为程序员拥有的正常解决问题的技能。
Given that you have MinGW installed, what happens if you download "Eclipse IDE for C/C++ developers", start eclipse.exe, and try to create a C++-project with a MinGW toolchain?
鉴于您已经安装了 MinGW,如果您下载“面向 C/C++ 开发人员的 Eclipse IDE”,启动 eclipse.exe,并尝试使用 MinGW 工具链创建 C++ 项目会发生什么?
EDIT: remember: the keyin getting help with problems like these is to produce a minimalexample which fails. Also, it would help if you provided URLs to the packages you installed (MinGW, Eclipse, etc.).
编辑:请记住:获得此类问题帮助的关键是生成一个失败的最小示例。此外,如果您提供所安装的软件包(MinGW、Eclipse 等)的 URL,也会有所帮助。
EDIT: I just installed CDT using the Ganymede update site, downloaded and installed MinGW from here, and restarted Eclipse, and everything worked fine. I know that doesn't help you, but it does prove that the toolchain detection isn't completely broken. Something is weird on your side.
编辑:我刚刚使用 Ganymede 更新站点安装了 CDT,从这里下载并安装了 MinGW ,然后重新启动 Eclipse,一切正常。我知道这对您没有帮助,但它确实证明工具链检测并未完全损坏。你那边有些奇怪。
回答by McDowell
The instructions for setting up MinGW in Ganymede are located here.
在 Ganymede 中设置 MinGW 的说明位于此处。
The following are instructions and links on how to install the current version of MinGW. Note that these links may become inaccurate over time as new versions of MinGW components are introduced. Please check the MinGW File Release section for the latest versions.
- Download and run the MinGW setup program, MinGW-5.1.3.exe.
Select download and install the MinGW base tools and the g++ compiler. You may select the Current or Candidate version of these tools. You may also install any of the other available compilers as well.
Do not install the MinGW Make feature as the MSYS version of make from step 5 is a more complete implementation of make.
- The MinGW setup program currently does not install the gdb debugger. To install the debugger, download the file from the following location: gdb-6.6.tar.bz2
- Extract the contents of the file gdb-6.6.tar.bz2 to the same location where you installed MinGW.
- If you want to use Makefile projects, download and run the setup program from the following location: MSYS-1.0.10.exe. MSYS provides an implementation of make and related command line tools. This is not required for other types of projects with the MinGW toolchain, which use CDT's internal build tools to perform the build.
以下是有关如何安装当前版本的 MinGW 的说明和链接。请注意,随着新版本的 MinGW 组件的引入,这些链接可能会随着时间的推移变得不准确。请查看 MinGW 文件发布部分以获取最新版本。
- 下载并运行 MinGW 安装程序 MinGW-5.1.3.exe。
选择下载并安装 MinGW 基础工具和 g++ 编译器。您可以选择这些工具的当前或候选版本。您也可以安装任何其他可用的编译器。
不要安装 MinGW Make 功能,因为第 5 步中的 MSYS 版本的 make 是更完整的 make 实现。
- MinGW 安装程序当前未安装 gdb 调试器。要安装调试器,请从以下位置下载文件:gdb-6.6.tar.bz2
- 将文件 gdb-6.6.tar.bz2 的内容解压到安装 MinGW 的同一位置。
- 如果要使用 Makefile 项目,请从以下位置下载并运行安装程序:MSYS-1.0.10.exe。MSYS 提供了 make 和相关命令行工具的实现。对于其他类型的具有 MinGW 工具链的项目,这不是必需的,这些项目使用 CDT 的内部构建工具来执行构建。
Following this process resolved any problems I had.
按照这个过程解决了我遇到的任何问题。
回答by recipriversexclusion
I had the same exact problem with Eclipse Galileo and CDT 6.0.1. It turns out that CDT only recognized MinGW when it's located under c:\mingw. I had it in c:\msys\mingw so that was the problem. After I changed that everything worked fine.
我在 Eclipse Galileo 和 CDT 6.0.1 上遇到了同样的问题。事实证明,CDT 仅在位于 c:\mingw 下时才能识别 MinGW。我把它放在 c:\msys\mingw 中,所以这就是问题所在。在我更改后,一切正常。
回答by Mike Kucera
You could try Wascana Desktop Developer. Its a distribution of Eclipse CDT configured specifically for developing on Windows.
你可以试试Wascana Desktop Developer。它是专门为在 Windows 上开发而配置的 Eclipse CDT 发行版。
回答by Scott D. Strader
I had the same problem (i.e. Eclipse not finding MinGW on the PATH) after I removed some of the unused files/folders from MinGW. It was ~600 MB and I was tasked to trim it down before adding to source control. I got it down to a workable ~200 MB. When I tried to re-create an Eclipse workspace afterwards, MinGW disappeared from available toolchains. It reappeared after I put the original MinGW install on the path.
从 MinGW 中删除一些未使用的文件/文件夹后,我遇到了同样的问题(即 Eclipse 在 PATH 上找不到 MinGW)。它大约为 600 MB,我的任务是在添加到源代码管理之前将其缩减。我把它压缩到一个可行的 ~200 MB。当我之后尝试重新创建 Eclipse 工作区时,MinGW 从可用工具链中消失了。在我将原始 MinGW 安装放在路径上后,它再次出现。
HTH
HTH