我使用 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