Error in openssl-sys 0.9.84 while compiling

While compiling a rust based project which uses openssl-sys depedency -> got an error ->

error[E0277]: the trait bound `[PathBuf]: AsRef<Path>` is not satisfied
   --> /home/divyanshgupta/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.84/build/run_bindgen.rs:192:18
    |
192 |         .include(include_dirs)
    |          ------- ^^^^^^^^^^^^ the trait `AsRef<Path>` is not implemented for `[PathBuf]`, which is required by `&[PathBuf]: AsRef<Path>`
    |          |
    |          required by a bound introduced by this call
    |
    = help: the following other types implement trait `AsRef<T>`:
              [T; N]
              [T]
    = note: required for `&[PathBuf]` to implement `AsRef<Path>`
note: required by a bound in `Build::include`
   --> /home/divyanshgupta/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cc-1.0.41/src/lib.rs:323:23
    |
323 |     pub fn include<P: AsRef<Path>>(&mut self, dir: P) -> &mut Build {
    |                       ^^^^^^^^^^^ required by this bound in `Build::include`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `openssl-sys` (build script) due to 1 previous error

please tell how to solve this.

Which version of rustc do you use?

rustc 1.77.1 (7cf61ebde 2024-03-27)

0.9.84 is not the latest version. Try running cargo update to see if this has been fixed already.

Yeah , Thanks It solves my problem.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.