Installation msys2 under windows7

System: windows 7

Msys2 first need to install the package, you can go to the official website to download the installation package
official website address: http://www.msys2.org/
This download is msys2-x86_64-20190524.exe

Note: 1.msys2 not be installed in the partition FAT *
   2.msys2 can not be installed on the win XP system

1. Install

Double-click to start the installation msys2-x86_64-20190524.exe

Middle can choose the installation directory, the path should be short, with no spaces, only use ASCII characters, can not use single quotes
I was installed in D: \ under msys64

Then the next, until the beginning of the installation, the installation process took me about 3-5 minutes

Click Finish to exit the installation program after the installation is complete
Note: Do not check the "Run Now MSYS2 64bit" here, because the next step is to configure the update source country

2. Configure the update source country

Here is a selection of USTC the source, you can also search for other sources, such as Ali cloud sources, such as Tsinghua University,

Modify "installation location \ etc \ pacman.d" three profiles (Ps: I have this machine installation directory D: \ msys64 \ etc \ pacman.d ) in
mirrorlist.msys
mirrorlist.mingw32
mirrorlist.mingw64

To modify the three places
add mirrorlist.msys the
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/

Mirrorlist.msys modified file contents as follows
##
## MSYS2 Repository mirrorlist
##

## Primary
## msys2.org
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/
Server = http://repo.msys2.org/msys/$arch/
Server = https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/$arch/
Server = http://www2.futureware.at/~nickoe/msys2-mirror/msys/$arch/
Server = https://mirror.yandex.ru/mirrors/msys2/msys/$arch/

Add mirrorlist.mingw32 the
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/

Mirrorlist.mingw32 modified file contents below
##
## 32-W64 'bit the Mingw-Repository the mirrorlist
##

## Primary
## msys2.org
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/
Server = http://repo.msys2.org/mingw/i686/
Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686/
Server = http://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/i686/

Add mirrorlist.mingw64 the
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/

Mirrorlist.mingw64 modified file contents below
##
## 64-W64 'bit the Mingw-Repository the mirrorlist
##

## Primary
## msys2.org
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/
Server = http://repo.msys2.org/mingw/x86_64/
Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/
Server = http://www2.futureware.at/~nickoe/msys2-mirror/mingw/x86_64/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/x86_64/

3. Update system core and a variety of packages, etc.

Open the menu "MSYS2 MinGW 64-bit" icon
to perform twice pacman open -Syu command to update the system core and a variety of packages, etc.

Performing the intermediate command to enter a "Y" key to confirm

Note: The first update will encounter a warning, then be sure to click × upper right corner to close the window
will pop up a dialog box (shown below) when you close the window, click OK on it

After the first execution of the command, the update is not over, we need to continue to update,

To reconfigure the update source before proceeding with the update, because the three configuration files directory "installation location \ etc \ pacman.d" in mirrorlist.msys, mirrorlist.mingw32, mirrorlist.mingw64 will be updated due to the above update (so to speak uncomfortable do), you need to press step 3 reconfigure update source.

After the re-configured update source, open "MSYS2 MinGW 64-bit" again,
and then perform a pacman -Syu

Such updates can be successfully ended, msys2 also successfully concluded the installation

4. Install build environment

Msys2 install this program is to write a compiler, so the compiler environment or installation necessary

Install gcc, gcc execute the following command to install the MinGW-w64 matching
command: pacman -S mingw-w64-x86_64
-gcc Note: If you want to run the compiled program in the windows environment, remember to statically compiled

Execution pacman -S make make install

done!

Guess you like

Origin www.cnblogs.com/zqifa/p/10974433.html