Orb_slam2: Libopencv_calib3d3 error

Created on 13 Dec 2017  路  9Comments  路  Source: raulmur/ORB_SLAM2

How to solve the following error?
[ 0%] Built target rosbuild_precompile
make[2]: * No rule to make target '/opt/ros/kinetic/lib/libopencv_calib3d3.so.3.2.0', needed by '../Mono'. Stop.
CMakeFiles/Makefile2:718: recipe for target 'CMakeFiles/Mono.dir/all' failed
make[1]:
[CMakeFiles/Mono.dir/all] Error 2
make[1]:
Waiting for unfinished jobs....
make[2]:
No rule to make target '/opt/ros/kinetic/lib/libopencv_calib3d3.so.3.2.0', needed by '../RGBD'. Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]:
[CMakeFiles/RGBD.dir/all] Error 2
make[2]:
No rule to make target '/opt/ros/kinetic/lib/libopencv_calib3d3.so.3.2.0', needed by '../Stereo'. Stop.
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Stereo.dir/all' failed
make[1]:
[CMakeFiles/Stereo.dir/all] Error 2
make[2]:
No rule to make target '/opt/ros/kinetic/lib/libopencv_calib3d3.so.3.2.0', needed by '../MonoAR'. Stop.
CMakeFiles/Makefile2:820: recipe for target 'CMakeFiles/MonoAR.dir/all' failed
make[1]:
[CMakeFiles/MonoAR.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *
[all] Error 2

Most helpful comment

Example/ROS/CMakeLists.txt
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
-lboost_system
)

All 9 comments

This happened to me just now after a Ubuntu update, which apparently upgraded libopencv_calib3d3.so.3.2.0 to libopencv_calib3d3.so.3.3.1. Deleting the build and devel folders and doing a catkin_make fixed it in my case. I'm working on a different package, but could still be useful.

In my case was the same but I reinstall ROS and for bad luck, the new ROS already have libopencv_calib3d3.so.3.3.1. Then I Deleted the build and devel folders but nothing it solve and appear new errors like:

/usr/bin/ld: CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/RGBD.dir/build.make:217: recipe for target '../RGBD' failed
make[2]: * [../RGBD] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]: *
[CMakeFiles/RGBD.dir/all] Error 2

deleting devel and build didnot solve the problem for me. Still have same error
:-1: error: No rule to make target '/opt/ros/kinetic/lib/libopencv_calib3d3.so.3.2.0', needed by 'RGBD'. Stop.

Try put -lboost_system in:
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
-lboost_system
)

Example/ROS/CMakeLists.txt
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
-lboost_system
)

This is a bug of OpenCV 3.3.1 which is the default version of ROS kinetic OpenCV3.
You can find the issue here and here

Run the following commands can fix this issue.

sed -i -r \
  's#set\(OpenCV_LIBS \$\{OpenCV_LIBS\} "\$\{__cvcomponent\}"\)#set\(OpenCV_LIBS \$\{OpenCV_LIBS\} "\$\{OpenCV_INSTALL_PATH\}/lib/lib\$\{__cvcomponent\}3.so")#' \
  /opt/ros/kinetic/share/OpenCV-3.3.1/OpenCVConfig.cmake

@Yvon-Shong
I am facing the same issue and have inserted the line "-lboost_system" just like you have suggested.. but it still shows the same errors. Can you suggest some other way?

Regards

This happened to me just now after a Ubuntu update, which apparently upgraded libopencv_calib3d3.so.3.2.0 to libopencv_calib3d3.so.3.3.1. Deleting the build and devel folders and doing a catkin_make fixed it in my case. I'm working on a different package, but could still be useful.

That worked for me. Thanks.

@raktimkashyap I'm facing the same issue were you able to resolve it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ColeHoff7 picture ColeHoff7  路  4Comments

nik13 picture nik13  路  5Comments

kilimeters picture kilimeters  路  3Comments

jinfagang picture jinfagang  路  4Comments

ank700 picture ank700  路  3Comments