opencv的错误记录
- 错误1:error while loading shared libraries: libopencv_core.so.4.5.0: cannot open shared object file: No such file or directory
解决:
在linux 的/etc/ld.so.conf.d 文件夹下创建OpenCV.conf文件
去修改文件,添加lib路径 /usr/local/opencv-4.5.0/lib。遇到的问题是权限不够,添加所有权限sudo touch OpenCV.conf
sudo chmod 777 OpenCV.conf
2. 错误2:OpenCV Error: Unspecified error (The function is notimplemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. Ifyou are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-runcmake or configure script) in cvNamedWindow,
发现断点卡在ui的相关函数imshow
重新下载依赖
sudo apt-get install libgtk2.0-dev
sudo apt-get install pkg-config
重新编译opencv
3. 错误3:terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(4.5.0) /home/nntzhc/Downloads/opencv-4.5.0/modules/highgui/src/window_gtk.cpp:635: error: (-2:Unspecified error) Can’t initialize GTK backend in function ‘cvInitSystem’
Aborted (core dumped)
没有GUI界面
后面突然灵机跑到linux下运行一下就行了。