MINGW
下载并安装msys2
修改镜像服务器 下面的命令必须在msys2里面执行
echo "Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/" > /etc/pacman.d/mirrorlist.mingw32
echo "Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64/" > /etc/pacman.d/mirrorlist.mingw64
echo "Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/\$arch/" > /etc/pacman.d/mirrorlist.msys
把ming64的路径加到环境变量
echo "export MINGW=/mingw64" >> ~/.bash_profile
echo "export PATH=\$MINGW/bin:\$PATH" >> ~/.bash_profile
上面修改镜像服务器的操作,会在这个目录C:\msys64\etc\pacman.d生成3个文件
mirrorlist.mingw32
mirrorlist.mingw64
mirrorlist.msys
添加环境变量的操作,可以在这样确认 cat ~/.bash_profile。在.bash_profile文件里面添加两行
export MINGW=/mingw64
export PATH=$MINGW/bin:$PATH
在Windows Terminal中集成msys2
https://www.msys2.org/docs/terminals/
直接编辑Windows的terminal的json配置文件settings.json
C:\Users\clu\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
在profiles的list里面,新增
{
"guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
"name": "UCRT64 / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/ucrt64.ico",
"font":
{
"face": "Lucida Console",
"size": 9
}
},
{
"guid": "{71160544-14d8-4194-af25-d05feeac7233}",
"name": "MSYS / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/msys2.ico",
"font":
{
"face": "Lucida Console",
"size": 9
}
},
MSYS2: What's the difference between UCRT 64 and x64?
Please take a look at the following guide: https://www.msys2.org/docs/environments/
The default MINGW32 and MINGW64 environments build binaries using the older MSVCRT library that should be present on all Windows systems.
The MINGW UCRT environments build binaries using the newer UCRT library that is only known to be present on Windows 10. It should produce binaries more compatible with MSVC-compiled binaries, but not with the MSVCRT environment.
bash: git: command not found in MSYS
pacman -S git
yes | pacman -Syu git
查看本机的architecture,在msys2里面执行
echo $(uname -m)