rust 如何调试“运行时库搜索路径中不包括路径/opt/homebrew/opt/opencv/lib,因为它在目标根目录之外...”

edqdpe6u  于 2022-11-12  发布在  其他
关注(0)|答案(1)|浏览(96)

我无法调试在运行包含OpenCV Rust绑定https://crates.io/crates/opencv/0.65.0的项目时出现的运行时错误
项目生成成功:

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

运行cargo命令失败: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)

我已经安装了来自brew的opencv:brew install opencv,并且可以确认/opt/homebrew/opt/opencv/lib存在并且被填充。
如何进行调试呢?

n3h0vuf2

n3h0vuf21#

上面的调试输出是一个转移注意力的内容。该问题实际上是由ERROR消息定义的。在实现OpenCV绑定的项目结构中缺少目录。

相关问题