如何在 Windows 7 机器上安装 gcc? [英] how to install gcc on windows 7 machine?

查看:62
本文介绍了如何在 Windows 7 机器上安装 gcc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Windows 7 机器上有 MinGW.我希望为 C 编译器安装和使用完整的 gcc.我发现没有用于此目的的单个预编译现成安装文件.我检查了以下页面:http://gcc.gnu.org/install/这很困难,我发现它超出了我的理解水平.任何人都可以为我提供一步一步的指导和链接吗?

I have MinGW on my windows 7 machine. I wish to install and use complete gcc for C compiler. I found there is no single pre-compiled ready-made installation file for this purpose. I checked the following page : http://gcc.gnu.org/install/ It is difficult and I find it above my level of understanding. Could any one please provide me step by step guidance along with links?

推荐答案

EDIT 从最近到现在,MinGW-w64 已经吸收"了其中一个工具链构建项目.可以在此处找到下载.安装程序应该可以工作,并允许您选择所需的版本.

EDIT Since not so recently by now, MinGW-w64 has "absorbed" one of the toolchain building projects. The downloads can be found here. The installer should work, and allow you to pick a version that you need.

请注意,Qt SDK 带有相同的工具链.因此,如果您使用 Qt 进行开发并使用 SDK,只需使用它附带的工具链即可.

Note the Qt SDK comes with the same toolchain. So if you are developing in Qt and using the SDK, just use the toolchain it comes with.

另一种具有最新工具链的替代方案来自......哈哈......一位微软开发人员,正是 STL(Stephan T. Lavavej,对于 MSVC++ 标准库的维护者来说,这不是一个恰当的名字!).您可以在此处找到它.它包括 Boost.

Another alternative that has up to date toolchains comes from... harhar... a Microsoft developer, none other than STL (Stephan T. Lavavej, isn't that a spot-on name for the maintainer of MSVC++ Standard Library!). You can find it here. It includes Boost.

如果您关心预构建的依赖项,另一个非常有用的选项是 MSYS2,它提供了一个 Unix shell(一个 Cygwin fork 修改为更好地与 Windows 路径名等一起工作),还提供了一个 GCC.它通常有点落后,但这可以通过其良好的包管理系统和稳定性来弥补.如果您关心此类事情,它们还提供带有 libc++ 的函数式 Clang.

Another option which is highly useful if you care for prebuilt dependencies is MSYS2, which provides a Unix shell (a Cygwin fork modified to work better with Windows pathnames and such), also provides a GCC. It usually lags a bit behind, but that is compensated for by its good package management system and stability. They also provide a functional Clang with libc++ if you care for such thing.

我将以下内容留作参考,但由于下面详述的限制,我强烈建议不要使用 MinGW.org.TDM-GCC(MinGW-w64 版本)提供了一些在您的特定情况下可能有用的技巧,但我建议始终使用 vanilla GCC 以获得最大兼容性.

I leave the below for reference, but I strongly suggest against using MinGW.org, due to limitations detailed below. TDM-GCC (the MinGW-w64 version) provides some hacks that you may find useful in your specific situation, although I recommend using vanilla GCC at all times for maximum compatibility.

GCC for Windows 目前由两个项目提供.它们都提供了自己的 Windows SDK(头文件和库)实现,这是必要的,因为 GCC 不适用于 Visual Studio 文件.

GCC for Windows is provided by two projects currently. They both provide a very own implementation of the Windows SDK (headers and libraries) which is necessary because GCC does not work with Visual Studio files.

  1. 较旧的 mingw.org,@Mat 已经向您指出.它们仅提供 32 位编译器.请参阅此处以获取您需要的下载:

  • Binutils 是链接器和资源编译器等.
  • GCC 是编译器,分为核心包和语言包
  • GDB 是调试器.
  • 只有 mingw.org 需要运行时库
  • 您可能需要单独下载 mingw32-make.
  • 如需支持,您可以尝试(不要指望友好回复)mingw-users@lists.sourceforge.net

或者,下载 mingw-get 并使用它.

Alternatively, download mingw-get and use that.

较新的 mingw-w64,顾名思义,也提供了 64 位变体,并且希望在未来提供一些 ARM 支持.我使用它并用他们的 CRT 构建工具链.个人和自动构建可在面向 Win32/64 的工具链"下找到此处.他们还为 Windows 交叉编译器提供 Linux.我建议您先尝试个人构建,它们更完整.在 GCC 4.6 到 4.8 中尝试使用我的 (rubenvb),或者在 GCC 4.4 和 4.5 中使用 sezero.我们都提供 32 位和 64 位原生工具链.这些软件包包括上面列出的所有内容.我目前推荐MinGW-Builds"版本,因为它们目前被批准为官方版本",并带有安装程序(见上文).

The newer mingw-w64, which as the name predicts, also provides a 64-bit variant, and in the future hopefully some ARM support. I use it and built toolchains with their CRT. Personal and auto builds are found under "Toolchains targetting Win32/64" here. They also provide Linux to Windows cross-compilers. I suggest you try a personal build first, they are more complete. Try mine (rubenvb) for GCC 4.6 to 4.8, or use sezero's for GCC 4.4 and 4.5. Both of us provide 32-bit and 64-bit native toolchains. These packages include everything listed above. I currently recommend the "MinGW-Builds" builds, as these are currently sanctioned as "official builds", and come with an installer (see above).

如需支持,请发送电子邮件至 mingw-w64-public@lists.sourceforge.net 或通过 sourceforge.net 在论坛上发帖.

For support, send an email to mingw-w64-public@lists.sourceforge.net or post on the forum via sourceforge.net.

两个项目都在 sourceforge 上列出了它们的文件,您所要做的就是运行安装程序(在 mingw.org 的情况下)或下载合适的压缩包并解压缩(在 mingw-w64 的情况下).

Both projects have their files listed on sourceforge, and all you have to do is either run the installer (in case of mingw.org) or download a suitable zipped package and extract it (in the case of mingw-w64).

有很多非官方"工具链构建器,其中最受欢迎的是 TDM-GCC.他们可能会使用破坏与官方/未打补丁的工具链的二进制兼容性的补丁,所以要小心使用它们.最好使用官方版本.

There are a lot of "non-official" toolchain builders, one of the most popular is TDM-GCC. They may use patches that break binary compatibility with official/unpatched toolchains, so be careful using them. It's best to use the official releases.

这篇关于如何在 Windows 7 机器上安装 gcc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆