No rule to make target `/usr/lib/arm-linux-gnueabihf/libopencv_videostab.so.2.4.8'

简介: No rule to make target `/usr/lib/arm-linux-gnueabihf/libopencv_videostab.so.2.4.8'

在ubuntu14.04下安装kinect报了很多错误:主要是opencv的版本与ros之间的冲突:

报错:

make[2]: *** 没有规则可以创建“/.so”需要的目标“/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4.8”。 停止。

卸载cv_bridge重装:

sudo apt-get remove ros-indigo-cv-bridge

1.指定opencv版本编译

这一步不管你单纯是cmake工程或者是ros的包,都可以通过下面的办法在CMakeLists.txt中添加相应的语句来选择不同版本的OpenCV进行编译。

1. set(OpenCV_DIR /home/ubuntu/opencv-2.4.13.6)
2. find_package(OpenCV 2.4 REQUIRED)
3. include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS} /home/ubuntu/opencv-2.4.13.6/include)
4. link_directories(${OpenCV_LIBRARY_DIRS} /home/ubuntu/opencv-2.4.13.6/lib)

2.cv_bridge与opencv兼容性问题

ROS kinetic中的cv_bridge中默认使用自带opencv3,而我们人脸识别程序使用的是opencv2,而需要解决cv3和cv2不兼容的问题,解决办法很简单,那就是找到/opt/ros/indigio/share/cv_bridge/cmake中的cv_bridgeConfig.cmake

 

1. if(NOT "include;/home/ubuntu/opencv-2.4.13.6;/home/ubuntu/opencv-2.4.13.6/include " STREQUAL " ")
2. set(cv_bridge_INCLUDE_DIRS "")
3. set(_include_dirs "include;/home/ubuntu/opencv-2.4.13.6;/home/ubuntu/opencv-2.4.13.6/include")

还有几个so文件路径改一下,在这里我们的路径在/usr/local/lib下,同理只要将上面的/usr/lib/x86_64-linux-gnu/路径改为自己的路径即可。

set(libraries "cv_bridge;/usr/local/lib/libopencv_videostab.so.2.4.13;/usr/local/lib/libopencv_video.so.2.4.13;/usr/local/lib/libopencv_superres.so.2.4.13;/usr/local/lib/libopencv_stitching.so.2.4.13;/usr/local/lib/libopencv_photo.so.2.4.13;/usr/local/lib/libopencv_ocl.so.2.4.13;/usr/local/lib/libopencv_objdetect.so.2.4.13;/usr/local/lib/libopencv_ml.so.2.4.13;/usr/local/lib/libopencv_legacy.so.2.4.13;/usr/local/lib/libopencv_imgproc.so.2.4.13;/usr/local/lib/libopencv_highgui.so.2.4.13;/usr/local/lib/libopencv_gpu.so.2.4.13;/usr/local/lib/libopencv_flann.so.2.4.13;/usr/local/lib/libopencv_features2d.so.2.4.13;/usr/local/lib/libopencv_core.so.2.4.13;/usr/local/lib/libopencv_contrib.so.2.4.13;/usr/local/lib/libopencv_calib3d.so.2.4.13")

此问题主要是对应目录没有相应的库,通过下面的脚本建立库的软连接。

3.建立脚本,changelib.sh

1. sudo ln -s /usr/local/lib/libopencv_calib3d.so /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.2.4.8
2. sudo ln -s /usr/local/lib/libopencv_contrib.so /usr/lib/x86_64-linux-gnu/libopencv_contrib.so.2.4.8
3. sudo ln -s /usr/local/lib/libopencv_core.so /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.8
4. sudo ln -s /usr/local/lib/libopencv_detection_based_tracker.so /usr/lib/x86_64-linux-gnu/libopencv_detection_based_tracker.so.2.4.8
5. sudo ln -s /usr/local/lib/libopencv_esm_panorama.so /usr/lib/x86_64-linux-gnu/libopencv_esm_panorama.so.2.4.8
6. sudo ln -s /usr/local/lib/libopencv_facedetect.so /usr/lib/x86_64-linux-gnu/libopencv_facedetect.so.2.4.8
7. sudo ln -s /usr/local/lib/libopencv_features2d.so /usr/lib/x86_64-linux-gnu/libopencv_features2d.so.2.4.8
8. sudo ln -s /usr/local/lib/libopencv_flann.so /usr/lib/x86_64-linux-gnu/libopencv_flann.so.2.4.8
9. sudo ln -s /usr/local/lib/libopencv_gpu.so /usr/lib/x86_64-linux-gnu/libopencv_gpu.so.2.4.8
10. sudo ln -s /usr/local/lib/libopencv_highgui.so /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8
11. sudo ln -s /usr/local/lib/libopencv_imgproc.so /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4.8
12. sudo ln -s /usr/local/lib/libopencv_imuvstab.so /usr/lib/x86_64-linux-gnu/libopencv_imuvstab.so.2.4.8
13. sudo ln -s /usr/local/lib/libopencv_legacy.so /usr/lib/x86_64-linux-gnu/libopencv_legacy.so.2.4.8
14. sudo ln -s /usr/local/lib/libopencv_ml.so /usr/lib/x86_64-linux-gnu/libopencv_ml.so.2.4.8
15. sudo ln -s /usr/local/lib/libopencv_objdetect.so /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so.2.4.8
16. sudo ln -s /usr/local/lib/libopencv_photo.so /usr/lib/x86_64-linux-gnu/libopencv_photo.so.2.4.8
17. sudo ln -s /usr/local/lib/libopencv_stitching.so /usr/lib/x86_64-linux-gnu/libopencv_stitching.so.2.4.8
18. sudo ln -s /usr/local/lib/libopencv_superres.so /usr/lib/x86_64-linux-gnu/libopencv_superres.so.2.4.8
19. sudo ln -s /usr/local/lib/libopencv_tegra.so /usr/lib/x86_64-linux-gnu/libopencv_tegra.so.2.4.8
20. sudo ln -s /usr/local/lib/libopencv_video.so /usr/lib/x86_64-linux-gnu/libopencv_video.so.2.4.8
21. sudo ln -s /usr/local/lib/libopencv_videostab.so /usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4.8
22. sudo ln -s /usr/local/lib/libopencv_vstab.so /usr/lib/x86_64-linux-gnu/libopencv_vstab.so.2.4.8
23. 
24. sudo ln -s /usr/local/lib/libopencv_ts.a /usr/lib/x86_64-linux-gnu/libopencv_ts.so.2.4.8
25. sudo ln -s /usr/local/lib/libopencv_ocl.so.2.4.13 /usr/lib/x86_64-linux-gnu/libopencv_ocl.so.2.4.8

4.运行:sh ./changelib.sh

> 我的微信公众号名称深度学习与先进智能决策

> 微信公众号ID:MultiAgent1024

> 公众号介绍:主要研究分享深度学习、机器博弈、强化学习等相关内容!期待您的关注,欢迎一起学习交流进步!

 

相关实践学习
CentOS 7迁移Anolis OS 7
龙蜥操作系统Anolis OS的体验。Anolis OS 7生态上和依赖管理上保持跟CentOS 7.x兼容,一键式迁移脚本centos2anolis.py。本文为您介绍如何通过AOMS迁移工具实现CentOS 7.x到Anolis OS 7的迁移。
相关文章
|
6月前
|
Linux C++
Linux自动化构建工具——make和Makefile使用详解
Linux自动化构建工具——make和Makefile使用详解
|
6月前
|
算法 数据可视化 Linux
Linux内核编译:深入理解`make menuconfig`命令
Linux内核编译:深入理解`make menuconfig`命令
447 0
|
6月前
|
编译器 Linux 数据库
Linux--gcc与make
Linux--gcc与make
|
6月前
|
IDE Linux 编译器
【Linux】项目自动化构建工具 —— make/Makefile
【Linux】项目自动化构建工具 —— make/Makefile
|
6月前
|
Go
ChaosBlade 1.7.3 make build_linux 有个报错 不知大家遇到过没
【2月更文挑战第23天】ChaosBlade 1.7.3 make build_linux 有个报错 不知大家遇到过没
51 1
|
21天前
|
Linux 开发工具
【Linux快速入门(二)】Linux与ROS学习之编译基础(make编译)
【Linux快速入门(二)】Linux与ROS学习之编译基础(make编译)
|
6月前
|
小程序 Linux 开发工具
【Linux】Linux 开发工具(vim、gcc/g++、make/Makefile)+【小程序:进度条】-- 详解
【Linux】Linux 开发工具(vim、gcc/g++、make/Makefile)+【小程序:进度条】-- 详解
|
5月前
|
Linux 开发工具 数据安全/隐私保护
Linux基础——Linux开发工具(下)_make/makefile
Linux基础——Linux开发工具(下)_make/makefile
45 1
|
4月前
|
Java Linux C++
【Linux】Make和Makefile快速入门
【Linux】Make和Makefile快速入门
29 0
|
5月前
|
Linux
【make/Makefile】Linux下进度条的设计与实现
【make/Makefile】Linux下进度条的设计与实现