douzhunlan5930 2015-02-19 18:16
浏览 340
已采纳

使用Golang进行Mac交叉编译(或替代)

Ok so I'm trying to compile my Awesomium go wrapper on my mac (everything works fine on linux). My problem is, when I try to compile I get

ld: warning: ignoring file /Library/Frameworks//Awesomium.framework/Awesomium, file was built for i386 which is not the architecture being linked (x86_64): /Library/Frameworks//Awesomium.framework/Awesomium Undefined symbols for architecture x86_64:

Fine. But that raises a few questions. First, I didn't have the option to download a x86_64 version for Mac, it was "the mac version" no architecture. Second, I checked a few other libraries and it seems like nothing is built x86_64.
Now I thought maybe I could make a i386 version just for osx but it seems it's extremely difficult, some say impossible, to cross compile cgo.

What are my options?

  • 写回答

1条回答 默认 最新

  • duansao20000508 2015-02-19 21:08
    关注

    I'm not sure if you're going to run into any other problems with the universal binary, but building an i386 go toolchain is fairly easy.

    http://golang.org/doc/install/source

    You can then set the GOHOSTARCH and GOARCH environment variables, e.g.

    GOHOSTARCH=386 GOARCH=386 ./all.bash
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器