V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
SlipStupig

MacOS 环境下 CGO 库依赖编译错误

  •  
  •   SlipStupig · Nov 30, 2020 · 1664 views
    This topic created in 1974 days ago, the information mentioned may be changed or developed.

    我使用 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
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3575 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 11:49 · PVG 19:49 · LAX 04:49 · JFK 07:49
    ♥ Do have faith in what you're doing.