MSYS2安装使用

MSYS2

Software Distribution and Building Platform for Windows

MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software.

It consists of a command line terminal called mintty, bash, version control systems like git and subversion, tools like tar and awk and even build systems like autotools, all based on a modified version of Cygwin. Despite some of these central parts being based on Cygwin, the main focus of MSYS2 is to provide a build environment for native Windows software and the Cygwin-using parts are kept at a minimum. MSYS2 provides up-to-date native builds for GCC, mingw-w64, CPython, CMake, Meson, OpenSSL, FFmpeg, Rust, Ruby, just to name a few.

To provide easy installation of packages and a way to keep them updated it features a package management system called Pacman, which should be familiar to Arch Linux users. It brings many powerful features such as dependency resolution and simple complete system upgrades, as well as straight-forward and reproducible package building. Our package repository contains more than 3200 pre-built packages ready to install.

For more details see 'What is MSYS2?' which also compares MSYS2 to other software distributions and development environments like CygwinWSLChocolateyScoop, ... and 'Who Is Using MSYS2?' to see which projects are using MSYS2 and what for.

Installation

  1. Download the installer: msys2-x86_64-20240507.exe

    (Optional) For more information on the installer, like command line options, or how to verify the checksum and signature of the installer, see the installer guide.

  2. Run the installer. Installing MSYS2 requires 64 bit Windows 10 or newer.

  3. Enter your desired Installation Folder (short ASCII-only path on a NTFS volume, no accents, no spaces, no symlinks, no subst or network drives, no FAT).

    Second screen of MSYS2 installation

  4. When done, click Finish.

    Third screen of MSYS2 installation

  5. Now MSYS2 is ready for you and a terminal for the UCRT64 environment will launch.

    Empty MSYS2 terminal window

  6. You will probably want to install some tools like the mingw-w64 GCC to start compiling projects. Run the following command:

    $ pacman -S mingw-w64-ucrt-x86_64-gcc
    
  7. The terminal window will show the output as below. Press 'Enter' to continue:

    resolving dependencies...
    looking for conflicting packages...
    
    Packages (15) mingw-w64-ucrt-x86_64-binutils-2.41-2
                mingw-w64-ucrt-x86_64-crt-git-11.0.0.r216.gffe883434-1
                mingw-w64-ucrt-x86_64-gcc-libs-13.2.0-2  mingw-w64-ucrt-x86_64-gmp-6.3.0-2
                mingw-w64-ucrt-x86_64-headers-git-11.0.0.r216.gffe883434-1
                mingw-w64-ucrt-x86_64-isl-0.26-1  mingw-w64-ucrt-x86_64-libiconv-1.17-3
                mingw-w64-ucrt-x86_64-libwinpthread-git-11.0.0.r216.gffe883434-1
                mingw-w64-ucrt-x86_64-mpc-1.3.1-2  mingw-w64-ucrt-x86_64-mpfr-4.2.1-2
                mingw-w64-ucrt-x86_64-windows-default-manifest-6.4-4
                mingw-w64-ucrt-x86_64-winpthreads-git-11.0.0.r216.gffe883434-1
                mingw-w64-ucrt-x86_64-zlib-1.3-1  mingw-w64-ucrt-x86_64-zstd-1.5.5-1
                mingw-w64-ucrt-x86_64-gcc-13.2.0-2
    
    Total Download Size:    49.38 MiB
    Total Installed Size:  418.82 MiB
    
    :: Proceed with installation? [Y/n]
    [... downloading and installation continues ...]
    
  8. Now you can call gcc to build software for Windows.

    $ gcc --version
    gcc.exe (Rev2, Built by MSYS2 project) 13.2.0
    
  9. After installing MSYS2 it will update itself via pacman, see the update guide for more information.

  • 22
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

未来AI编程

共鸣===鼓励 打赏您随意

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值