问题描述
以下文章详细介绍了如何使用Ubuntu / Linux对Windows的golang c共享对象进行交叉编译:
Trouble compiling Windows DLL using Golang 1.10
该解决方案似乎只是确保已安装mingw,然后指定以下两个环境变量:
GOOS = windows CC = i686-w64-mingw32-gcc
现在,我想做同样的事情来从Ubuntu构建Mac / Darwin的共享对象。我知道我可以设置GOOS = Darwin,但是应该使用什么正确的CC / gcc?当我不指定CC env变量时,我从使用GOOS = darwin设置的go build中收到以下错误:
/home/user/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find 1144: No such file or directory
/tmp/go-link-601074638/go.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)