win-msys2安装使用配置

1.下载msys2

  下载并安装

  此刻我们约定msys2安装在C:\msys32\目录下面。

2.镜像源配置

  找到目录C:\msys32\etc\pacman.d

  mirrorlist.mingw32 修改为  

##
## 32-bit Mingw-w64 repository mirrorlist
##

## Primary
## msys2.org
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/
Server = http://mirror.bit.edu.cn/msys2/mingw/i686/

  mirrorlist.mingw64 修改为

##
## 64-bit Mingw-w64 repository mirrorlist
##

## Primary
## msys2.org
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64/
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/
Server = http://mirror.bit.edu.cn/msys2/mingw/x86_64/

  mirrorlist.msys修改为

##
## MSYS2 repository mirrorlist
##

## Primary
## msys2.org
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch/
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/
Server = http://mirror.bit.edu.cn/msys2/msys/$arch/

3.环境变量配置

  设置win环境变量

  新增变量名PATH

  设置变量值:C:\msys32\mingw64\bin;C:\msys32\usr\bin;

  注意变量值顺序

4.pacman命令

  常见命令:  

pacman -Sy 更新软件包数据 
pacman -Syu 更新所有 
pacman -Ss xx 查询软件xx的信息 
pacman -S xx 安装软件xx
pacman -R xx 删除软件xx

5.安装gcc,g++编译器

#查询并找到msys/gcc
pacman -Ss gcc
#安装
pacman -S msys/gcc

6.安装make编译器

#查询并找到msys/make
pacman -Ss make
#安装
pacman -S msys/make

7.安装clion编译工具链

pacman-key --init
pacman -Syu
pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-extra-cmake-modules
pacman -S mingw-w64-x86_64-make
pacman -S mingw-w64-x86_64-gdb
pacman -S mingw-w64-x86_64-toolchain

 8.附上Win编译nginx

  https://www.cnblogs.com/iamyuxing/p/10883626.html

  http://nginx.org/en/docs/windows.html

 

  

  

posted @ 2020-04-15 22:41  李文学  阅读(2532)  评论(0编辑  收藏  举报