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

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

问题描述

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

由于MinGW-w64目前还不是最近才开始吸收工具链建设项目。可以在此处找到下载内容。安装程序应该工作,并允许你选择一个你需要的版本。



请注意,Qt SDK附带了相同的工具链。因此,如果您正在开发Qt并使用SDK,只需使用它自带的工具链即可。



具有最新工具链的另一种选择来自... harhar。 ..一位微软开发人员,无非是STL(Stephan T. Lavavej,并不是MSVC ++标准库维护人员的专属名称!)。您可以在此处找到它。它包括Boost。



我留下以供参考,但我强烈建议不要使用MinGW.org,这是由于以下详细的限制。 TDM-GCC(MinGW-w64版本)提供了一些你可能会发现在你的特定情况下有用的黑客,尽管我建议在任何时候都使用vanilla GCC来达到最大的兼容性。 b
$ b




目前,GCC for Windows由两个项目提供。它们都提供了自己的Windows SDK实现(头文件和库),这是必需的,因为GCC不能与Visual Studio文件一起工作。


  1. @Mat已经指向你的旧版mingw.org。它们只提供一个32位编译器。 请参阅此处了解您需要的下载内容:




    • Binutils是链接器和资源编译器等。

    • GCC是编译器,分为核心和语言包
    • >
    • GDB是调试器。

    • 运行时库仅用于mingw.org

    • 您可能需要下载mingw32
    • 对于支持,您可以尝试(不要期待友好的回复)mingw-users@lists.sourceforge.net



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

  2. 更新的mingw-w64, ,还提供了一个64位的变体,并在未来希望有一些ARM支持。我使用它并用它们的CRT构建了工具链。个人和自动构建位于工具链针对Win32 / 64此处。他们还提供Linux到Windows交叉编译器。我建议你先尝试个人建立,他们会更完整。尝试我的(rubenvb)GCC 4.6到4.8,或使用sezero的GCC 4.4和4.5。我们都提供32位和64位原生工具链。这些软件包包括上面列出的一切我目前推荐使用MinGW-Builds版本,因为这些版本目前被批准为官方版本,并附带一个安装程序(见上文)。

    发送电子邮件至mingw-w64-public@lists.sourceforge.net或通过sourceforge.net在论坛发帖。


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



有很多非官方工具链构建者,其中最受欢迎的是TDM-GCC。他们可能会使用破坏与官方/未修补工具链的二进制兼容性的补丁,因此请小心使用它们。最好使用正式版本。


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 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.

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.

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.

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 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. The older mingw.org, which @Mat already pointed you to. They provide only a 32-bit compiler. See here for the downloads you need:

    • Binutils is the linker and resource compiler etc.
    • GCC is the compiler, and is split in core and language packages
    • GDB is the debugger.
    • runtime library is required only for mingw.org
    • You might need to download mingw32-make seperately.
    • For support, you can try (don't expect friendly replies) mingw-users@lists.sourceforge.net

    Alternatively, download mingw-get and use that.

  2. 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).

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

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).

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天全站免登陆