Could not exec the linker `cc` error when running “cargo build”

前端 未结 1 460
借酒劲吻你
借酒劲吻你 2021-01-17 12:38

I just installed Rust on my Mac and rustc --version --verbose displays

rustc 1.0.0-nightly (91bdf23f5 2         


        
1条回答
  •  礼貌的吻别
    2021-01-17 13:38

    It looks like you have installed GCC and LLVM/clang via Homebrew. Checking out the shared macOS configurations, the linker defaults to cc. I have installed the macOS developer tools:

    $ clang --version
    Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin13.4.0
    Thread model: posix
    
    $ gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin13.4.0
    Thread model: posix
    
    $ cc --version
    Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin13.4.0
    Thread model: posix
    

    This is potentially something that Rust itself could fix, but you'd have to file a bug report / enhancement request. It's possible that you might be able to work around this by symlinking clang as cc, instead of just aliasing it, as aliases probably don't exist in the environment that Rust is calling out from.

    0 讨论(0)
提交回复
热议问题