编程知识 cdmana.com

GCC and MinGW-w64 for Windows

官方链接:WinLibs - GCC+MinGW-w64 compiler for Windows

What is it?

In short: it's a free C and C++ compiler for Microsoft Windows.

GCC: (GNU Compiler Collection) is a free and open source compiler for C and C++ (and other languages like Objective-C, Fortran, D).
MinGW-w64 :is a free and open source C library for targetting Windows 32-bit and 64-bit platforms.

它是什么?

简而言之:它是适用于 Microsoft Windows 的免费 C 和 C++ 编译器.

GCC(GNU Compiler Collection)is a free open source compiler,适用于 C 和 C++(以及其他语言,如 Objective-C、Fortran、D).
MinGW-w64是一个针对 Windows 32 位和 64 Free and open source for bit platforms C 库.
These combinations produce suitable Windows 的免费 C/C++ 编译器.
尽管 GCC 和 MinGW-w64 可以在其他平台(例如 Linux)used to generate Windows 可执行文件,但 WinLibs Projects only focus on building on Windows version running locally.

A few other tools have also been added,包括:

  • GDB - GNU 项目调试器
  • GNU Binutils - Collection of binary tools
  • GNU Make - A tool to control the generation of executables and other non-source files
  • Yasm - Yasm Modular assembler project
  • NASM - Network-wide assembler
  • JWasm - 一个免费的 MASM Compatible assembler
  • LLVM/Clang/LLD/LLDB - LLVM 编译器基础架构

它是给谁的?

WinLibs Might be exactly what you're looking for in these situations:

  • 您正在使用 Microsoft Windows,And want to get started with completely free software C 和/或 C++ 进行编程.
    For an easier start,You should probably use something likeCode::Blocks这样的 IDE .
  • You are already using another proprietary compiler(如 Microsoft Visual C/C++ 和 Visual Studio)written software,and want to test if your application uses the most common C/C++ 编译器进行编译:GCC.
  • 您已经为 Windows written software,But want to port it to other platforms(如 Linux 或 Apple macOS).
    使用 MSYS2 命令行时,You can access it on other platforms(如 GNU Autotools)Most of the command line tools also available on ,Allows you to create standard build instructions across platforms(如:./configure && make && make install).
    Another way to configure the build for each platform is to use CMake,It is also available for many platforms(包括 Windows).
  • You are used to being Linux 或 Apple macOS development on other platforms,And want to start as Windows 进行编程.
    如果您使用 MSYS2,then there is no need to learn any new commands.或者,If your existing project is already using GNU Autotools 或CMake等配置工具,You can get started right away Windows 构建.
  • You can't wait to try the latest C++ 标准的 C++ 开发人员.
    GCC Always implement new ones very quickly C++ 标准.You might even want to consider using the latest snapshot version.

MSVCRT 或 UCRT 运行时库?

传统上,MinGW-w64 编译器使用 MSVCRT as a runtime library,It's in all versions Windows 上都可用.由于 Windows 10 通用 C 运行时 (UCRT) 可作为 MSVCRT 的替代品.通用 C The runtime can also be installed on earlier versions Windows 上(请参阅:Windows中通用 C Runtime updates).

Unless you are targeting an older version Windows,否则 UCRT As a runtime library is a better choice,Because it is to better support the latest Windows version and to provide better standards conformance(另请参阅:Upgrade the code to generic CRT).

下载版本,Please open the official link, www.winlibs.com

使用方法:

一、Unzip to a directory on your computer;

二、Enter the following two commands in the directory,If there is version information, it will be output normally,说明可以正常使用;

三、把bin目录添加到环境变量中;

 

 至此,windows的GCCThe environment can be used normally.

版权声明
本文为[N-order Rubik's Cube]所创,转载请带上原文链接,感谢
https://cdmana.com/2022/218/202208060714385643.html

Scroll to Top