网上的方法测试了, 不行。可能环境不一样吧。
网上的方法如下:
要确保已安装epel仓库,没有安装的话,执行
$ sudo yum install -y epel-release.noarch
$ yum clean all
$ yum makecache
安装编译器
$ sudo yum install -y mingw-filesystem-base.noarch
$ sudo yum install -y mingw64-gcc.x86_64 mingw64-gcc-c++.x86_64
执行结果如下:
[root@aabbcc ~]# yum install -y mingw-filesystem-base.noarch
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
No package mingw-filesystem-base.noarch available.
Error: Nothing to do
后来在github上找到一个项目:
https://github.com/Zeranoe/mingw-w64-build
下载后执行脚本,就会编译好整个工具链
[root@CentOS83]# ./mingw-w64-build x86_64
[root@CentOS83 mingw-w