You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在darwin/arm64环境下交叉编译Windows/ARM64 DLL的CC参数咨询

解决Darwin/arm64下交叉编译Windows/arm64 DLL的CC参数问题

在Darwin/arm64架构设备上交叉编译Windows/arm64的DLL时,CC参数应指定为aarch64-w64-mingw32-gcc。

完整编译命令

GOOS=windows GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-w64-mingw32-gcc go build -o example.dll -buildmode=c-shared main.go

前置条件

确保你已经安装了支持Windows/arm64的交叉编译工具链。在Darwin/arm64上可以通过Homebrew安装:

brew install mingw-w64

Homebrew的mingw-w64包默认包含了针对x86_64和aarch64架构的Windows交叉编译工具,安装后aarch64-w64-mingw32-gcc会被放置在/opt/homebrew/bin目录下,确保该路径在你的系统PATH环境变量中即可直接调用。

内容的提问来源于stack exchange,提问作者Clark McCauley

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 10:55:21