我使用 CGO 编译一个程序,以前挺正常的自从装了 Xcode 后就编译异常,然后我卸载了 Xcode 之后就 CGO 编译不过了。报错内容为:
ld: library not found for -lvpx
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
我开始以为是 brew 安装的问题,后来我改成手动安装一样不行:
ld: warning: platform not specified
ld: warning: -arch not specified
ld: warning: No platform min-version specified on command line
ld: warning: ignoring file /usr/local/lib/libvpx.dylib, building for -unknown but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture unknown:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture unknown
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.