CentOS交叉编译Windows可执行程序

来源:Linux 教程 / 时间:2026-10-30
 
要确保已安装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

执行脚本 编译好整个工具链

# ./mingw-w64-build x86_64

标签: Cargo Rust项目
客服