Bindgen似乎无法在OSX上找到c声

问题描述

虽然我确定它做错了什么,但似乎找不到。我正在使用bindgen = "0.55.1"并尝试生成pjsip绑定,尽管在此之前问题似乎很明显。这是构建的输出

error: Failed to run custom build command for `test-pjsip v0.1.0 (/Users/bruce/Projects/rust/examples/test-pjsip)`

Caused by:
  process didn't exit successfully: `/Users/bruce/Projects/rust/examples/test-pjsip/target/debug/build/test-pjsip-b32f0a4a7fbb2d3e/build-script-build` (exit code: 101)
  --- stdout
  cargo:rustc-link-lib=pjsip
  cargo:rustc-link-lib=pjsua

  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at /usr/local/opt/llvm@11/lib/libclang.dylib Could not be opened: dlopen(/usr/local/opt/llvm@11/lib/libclang.dylib,2): Symbol not found: __ZTIN4llvm13ErrorInfoBaseE\n  Referenced from: /usr/local/opt/llvm@11/lib/libclang.dylib\n  Expected in: /Users/bruce/.rustup/toolchains/stable-x86_64-apple-darwin/lib/libLLVM.dylib\n in /usr/local/opt/llvm@11/lib/libclang.dylib"',/Users/bruce/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.55.1/src/lib.rs:1896:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

我通过bindgen上的brew install llvm的{​​{1}}建议安装了clang。我已经验证了/usr/local/opt/llvm@11/lib/libclang.dylib确实存在。我怀疑该符号不存在。我是否应该安装其他版本的clang,如果是,则安装什么版本?

解决方法

好吧,我决定brew uninstall llvm作为最后的绝望之举。这似乎已经解决了问题。现在,我只是在处理链接错误,这更有意义。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...