John Mela
John Mela

Reputation: 9

How to debug "Not including path /opt/homebrew/opt/opencv/lib in runtime library search path because it is outside target root..."

I am unable to debug a runtime error that exhibits when running a project that includes OpenCV Rust bindings https://crates.io/crates/opencv/0.65.0

The project builds successfully:

[17:24:47] myuser:metadata-portal git:(main*) $ cargo build --release
    Finished release [optimized] target(s) in 0.46s

Running a cargo command fails: cargo run --release collect

[2022-10-24T21:05:56Z DEBUG cargo::core::compiler] Not including path /opt/homebrew/opt/opencv/lib in runtime library search path because it is outside target root /Users/<myuser>/code/metadata-portal/target/release
Running `target/release/metadata-cli collect`
[2022-10-24T21:05:57Z ERROR] No such file or directory (os error 2)

I have installed opencv from brew: brew install opencv and can confirm that /opt/homebrew/opt/opencv/lib exists and is populated.

How might one go about debugging this?

Upvotes: 0

Views: 166

Answers (1)

John Mela
John Mela

Reputation: 9

The debug output above was a red herring. The issue was actually defined by the ERROR message. A directory was missing in the structure of the project that was implementing the OpenCV bindings.

Upvotes: 0

Related Questions