项目场景:
本人环境Ubuntu 16.04 ros-kinetic
另外在/home/OpenCV 3.4下安装了OpenCV 3.4
问题描述:
/usr/bin/ld: warning: libopencv_highgui.so.3.4, needed by /usr/local/lib/libgpd.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc.so.3.4, needed by /usr/local/lib/libgpd.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_core.so.3.4, needed by /usr/local/lib/libgpd.so, not found (try using -rpath or -rpath-link)
原因分析:
因为我没有把OpenCV 3.4安装在默认的路径下,编译器没找到这几个lib文件。
解决方案:
- locate 缺少的lib文件
locate libopencv_highgui.so.3.4
- 进入编译器lib目录
cd /usr/lib/x86_64-linux-gnu
- 建立软链接
sudo ln -s /home/yzh/opencv-3.4/lib/libopencv_highgui.so.3.4