I am encountering a build failure when trying to use the darknet-rust crate in combination with the opencv crate in my Rust project on Arch Linux. The project builds fine when either crate is used independently, but combining them leads to a build error related to libclang.
Environment:
OS: Arch Linux - 6.5.9-arch2-1
Rust version: 1.73.0
clang version: 16.0.6
darknet-rust version: 0.4
opencv version: 0.85.3
Steps to Reproduce:
Create a new Rust project.
Add darknet-rust and opencv to Cargo.toml.
Run cargo build.
Error Log:
=== Detected OpenCV module header dir at: /usr/include/opencv4/opencv2
=== Found OpenCV version: [version] in headers located at: /usr/include/opencv4
=== Generating code in: [...]/test_darknet/target/debug/build/opencv-[hash]/out
=== Placing generated bindings into: [...]/test_darknet/target/debug/build/opencv-[hash]/out/opencv
=== Using OpenCV headers from: /usr/include/opencv4
thread 'main' panicked at [...]/.cargo/registry/src/index.crates.io-[hash]/clang-sys-1.6.1/src/lib.rs:1735:1:
a `libclang` shared library is not loaded on this thread
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Troubleshooting Steps:
Set LIBCLANG_PATH to /usr/lib.
Tried different versions of the crates.
Installed libclang and verified its presence.
Any help or guidance on resolving this issue would be greatly appreciated.
Description:
I am encountering a build failure when trying to use the
darknet-rust
crate in combination with theopencv
crate in my Rust project on Arch Linux. The project builds fine when either crate is used independently, but combining them leads to a build error related tolibclang
.Environment:
clang
version: 16.0.6darknet-rust
version: 0.4opencv
version: 0.85.3Steps to Reproduce:
darknet-rust
andopencv
toCargo.toml
.cargo build
.Error Log:
Troubleshooting Steps:
LIBCLANG_PATH
to/usr/lib
.libclang
and verified its presence.Any help or guidance on resolving this issue would be greatly appreciated.