MINGW

https://github.com/ejoy/ant

 

下载并安装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)

 

 

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(32)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2022-01-18 幂指函数的处理
2022-01-18 线性代数 行列式的计算
2021-01-18 HTTP request smuggling
2019-01-18 get the request body of all quests before handle it
2019-01-18 HTTP Message Handlers in ASP.NET Web API
2019-01-18 Difference between RouteTable.Routes and HttpConfiguration.Routes?
2019-01-18 Secure a Web API with Individual Accounts and Local Login in ASP.NET Web API 2.2
点击右上角即可分享
微信分享提示