RustAudio / coreaudio-sys

Raw bindings to the OSX CoreAudio framework generated by bindgen (see coreaudio-rs for a more rust-esque wrapper).
MIT License
69 stars 38 forks source link

Trying to install on MacOS return: Unable to find libclang #94

Closed jBernavaPrah closed 8 months ago

jBernavaPrah commented 8 months ago

Hi,

I have already read all the tickets in this repo and the clang-sys repo related to this issue, but none of the suggestions posted seem to work.

Recap:

  1. Uninstalled the LLVM using brew: brew uninstall llvm.
  2. Reinstalled the latest version of Xcode Comand line tools.
  3. In my previous life I did some experiments with clang & Co., so sure there is something f*** on my config.

Command: cc --version/clang --v

% cc --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Command: xcode-select -p

% xcode-select -p
/Library/Developer/CommandLineTools

Error:

--- stderr
  thread 'main' panicked at /Users/___/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/lib.rs:622:31:
  Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.dylib'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
  stack backtrace:

Would you happen to have any other suggestions for me to check? Thanks!

jBernavaPrah commented 8 months ago

Find the problem:

I had the LIBCLANG_PATH set to an espressif toolchain.

If you have the same issues, check also those paths: LLVM_CONFIG_PATH, LIBCLANG_STATIC_PATH and CLANG_PATH. More info on Environment Variable, on clang-sys.

simlay commented 8 months ago

I had the LIBCLANG_PATH set to an espressif toolchain.

Ah yes. I've had this problem. The espup and other tool are quite nice but wish there was a way around needing to set the LIBCLANG_PATH. Glad you figured it out!