Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build OpenCV Crate : failed to run custom build command for clang-sys v1.7.0 #554

Closed
Gtucker3d opened this issue Mar 27, 2024 · 3 comments

Comments

@Gtucker3d
Copy link

Before reporting an issue please first check the
troubleshooting guide. If
the issue you're encountering is not solved thereby please state the following in your bugreport:

  1. windows 64
  2. cargo add opencv, cargo build
  3. OpenCV version 0.89.0
  4. rustc version (rustc --version) rustc 1.78.0-nightly
  5. Attach the full output of the following command from your project directory:
    RUST_BACKTRACE=full cargo build -vv 

cargo build
Compiling clang-sys v1.7.0
Compiling num-traits v0.2.18
error: failed to run custom build command for clang-sys v1.7.0

Caused by:
process didn't exit successfully: C:\Users\alexs\Desktop\rust_projects\openve_tests\target\debug\build\clang-sys-8dad49d408f57131\build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at C:\Users\alexs.cargo\registry\src\index.crates.io-6f17d22bba15001f\clang-sys-1.7.0\build\dynamic.rs:206:45:
called Result::unwrap() on an Err value: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])"
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

RUST_BACKTRACE=full cargo build

RUST_BACKTRACE=full : The term 'RUST_BACKTRACE=full' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1

  • RUST_BACKTRACE=full cargo build -vv
  •   + CategoryInfo          : ObjectNotFound: (RUST_BACKTRACE=full:String) [], CommandNotFo 
     undException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
@twistedfall
Copy link
Owner

This error originates from clang-sys crate, it's can't find your clang installation. Can you please refer to the crate's readme on the ways to fix this? https://crates.io/crates/clang-sys

@Ktmr-Ktsh
Copy link

I'm the same question. I wonder what's going on?
Compiling clang-sys v1.8.1
Compiling regex v1.10.4
Compiling jobserver v0.1.31
Compiling maplit v1.0.2
The following warnings were emitted during compilation:

warning: clang-sys@1.8.1: could not execute llvm-config one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid llvm-config executable it will be used to try to find an instance of libclang on your system: "couldn't execute llvm-config --prefix (path=llvm-config) (error: program not found)"

error: failed to run custom build command for clang-sys v1.8.1

Caused by:
process didn't exit successfully: C:\Users\Administrator\OneDrive\桌面\Rust\openrust\target\debug\build\clang-sys-5f7e6fd30ae4a8a1\build-script-build (exit code: 101)
--- stdout
cargo:warning=could not execute llvm-config one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid llvm-config executable it will be used to try to find an instance of libclang on your system: "couldn't execute llvm-config --prefix (path=llvm-config) (error: program not found)"

--- stderr
thread 'main' panicked at C:\Users\Administrator.cargo\registry\src\index.crates.io-6f17d22bba15001f\clang-sys-1.8.1\build\dynamic.rs:225:45:
called Result::unwrap() on an Err value: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])"
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@twistedfall
Copy link
Owner

Repository owner deleted a comment from Ktmr-Ktsh Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants