![]() |
英俊的野马 · python-docx表格设置 - 简书· 1 年前 · |
![]() |
安静的黄豆 · Java之Byte和blob相互转换(Ora ...· 1 年前 · |
![]() |
冷静的楼房 · HeidiSQL、Navicat、mysql ...· 1 年前 · |
![]() |
俊逸的海豚 · JS中怎样在空对象中动态添加值(键值对 ...· 1 年前 · |
![]() |
温文尔雅的猴子 · pytorch小坑:需设置CUDA_HOME ...· 1 年前 · |
我在Ubuntu Linux上运行OpenCvShare时遇到了问题。它一直说找不到libOpenCvSharpExtern。
我在我的Ubuntu18.04.1 x64上运行OpenCvSharp时遇到了问题。我已经创建了一个.NET核心/标准解决方案(标准是一个库项目,核心是运行者)。库项目引用Nuget包: OpenCvSharp4 (4.0.0.20181225) OpenCvSharp4.runtime.ubuntu.18.04-x64 (4.0.0.20181225)。
然后,在成功编译之后,我使用以下命令发布了runner项目:
dotnet publish -c Release -r ubuntu.18.04-x64
当我在Ubuntu上运行可执行文件时,抛出了以下错误:
Unhandled Exception: OpenCvSharp.OpenCvSharpException: Failed to create VideoCapture System.TypeInitializationException: The type initializer for 'OpenCvSharp.NativeMethods' threw an exception. OpenCvSharp.OpenCvSharpException: Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libOpenCvSharpExtern: cannot open shared object file: No such file or directory ---> System.DllNotFoundException: Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libOpenCvSharpExtern: cannot open shared object file: No such file or directory
文件libOpenCvSharpExtern.so与可执行文件在同一路径中,我也将其复制到usr/local/lib中,而id没有帮助。应用程序的目的是基于摄像头视频源检测人脸。
好了,我终于让它运行起来了。问题出在包含路径中。当您从库所在路径中的终端执行
ldd libOpenCvSharpExtern.so
时,它将输出此库使用的所有引用库。最初,我有一个完整的“未找到”的引用列表。所有缺少的库都已安装在
/usr/local/lib
中。事实证明,该路径不是系统查找库的默认路径。
Link to a question on ubuntu forum
在我添加
export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib"
环境变量并重新启动系统后,一切都开始正常工作,并且在libOpenCvSharpExtern.so库上使用
ldd
清楚地显示,所有的库都被找到了。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2023 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号: 粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
扫码关注腾讯云开发者
领取腾讯云代金券
![]() |
英俊的野马 · python-docx表格设置 - 简书 1 年前 |