首先需要安装一个命令行的工作,我们这里安装的是msys2,直接百度地址然后安装即可,我这里安装的是64位
安装好之后进行该软件源配置
修改mirrorlist.msys
## Primary
## msys2.org
## Server = http://repo.msys2.org/msys/$arch
## Server = https://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/$arch
## Server = http://www2.futureware.at/~nickoe/msys2-mirror/msys/$arch/
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch
修改mirrorlist.mingw32
## Primary
## msys2.org
## Server = http://repo.msys2.org/mingw/i686
## Server = https://downloads.sourceforge.net/project/msys2/REPOS/MINGW/i686
## Server = http://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i68
修改mirrorlist.mingw64
## Primary
## msys2.org
## Server = http://repo.msys2.org/mingw/x86_64
## Server = https://downloads.sourceforge.net/project/msys2/REPOS/MINGW/x86_64
## Server = http://www2.futureware.at/~nickoe/msys2-mirror/mingw/x86_64
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64
使用msys安装软件
# pacman -S mingw-w64-x86_64-gtk3
# pacman -S mingw-w64-x86_64-gtk2
# pacman -S mingw-w64-x86_64-glade
# pacman -S mingw-w64-x86_64-devhelp
# pacman -S mingw-w64-x86_64-toolchain base-devel
添加环境变量,我这里安装到的是C盘
C:msys64usrin
C:msys64mingw64in
验证是否成功
pkg-config --cflags gtk+-2.0
make -v