Closed jacksonkr closed 8 years ago
Make sure that in your PATH
(or LD_LIBRARY_PATH
), the opencv libraries found first are those corresponding to those used on compilation (cmake path).
Hi @jacksonkr I have installed ubuntu 14.04 + ROS indigo + openCv 2.4.8.
But I am getting similar error as you have discussed above..
-- Build files have been written to: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build gaurav@gaurav-HP-Z420-Workstation:~/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build$ cmake .. -DROS_BUILD_TYPE=Release [rosbuild] Building package ORB_SLAM2 [rosbuild] using multiarch 'x86_64-linux-gnu' for finding Boost -- Using CATKIN_DEVEL_PREFIX: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/devel -- Using CMAKE_PREFIX_PATH: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/devel;/home/gaurav/catkin_ws/devel;/opt/ros/indigo -- This workspace overlays: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/devel;/home/gaurav/catkin_ws/devel;/opt/ros/indigo -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Skip enable_testing() for dry packages -- Using CATKIN_TEST_RESULTS_DIR: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be built -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.6.19 -- Using these message generators: gencpp;genlisp;genpy [rosbuild] Including /opt/ros/indigo/share/roslisp/rosbuild/roslisp.cmake [rosbuild] Including /opt/ros/indigo/share/roscpp/rosbuild/roscpp.cmake [rosbuild] Including /opt/ros/indigo/share/rospy/rosbuild/rospy.cmake Build type: Release -- Using flag -std=c++11. -- Configuring done CMake Warning at /opt/ros/indigo/share/ros/core/rosbuild/public.cmake:509 (add_executable): Cannot generate a safe linker search path for target RGBD because files in some directories may conflict with libraries in implicit directories:
link library [libopencv_videostab.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_video.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_superres.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_stitching.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_photo.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ocl.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_objdetect.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ml.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_legacy.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_imgproc.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_highgui.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_gpu.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_flann.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_features2d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_core.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_contrib.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_calib3d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
Some of these libraries may not be found correctly. Call Stack (most recent call first): CMakeLists.txt:90 (rosbuild_add_executable)
CMake Warning at /opt/ros/indigo/share/ros/core/rosbuild/public.cmake:509 (add_executable): Cannot generate a safe linker search path for target Stereo because files in some directories may conflict with libraries in implicit directories:
link library [libopencv_videostab.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_video.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_superres.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_stitching.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_photo.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ocl.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_objdetect.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ml.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_legacy.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_imgproc.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_highgui.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_gpu.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_flann.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_features2d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_core.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_contrib.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_calib3d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
Some of these libraries may not be found correctly. Call Stack (most recent call first): CMakeLists.txt:81 (rosbuild_add_executable)
CMake Warning at /opt/ros/indigo/share/ros/core/rosbuild/public.cmake:509 (add_executable): Cannot generate a safe linker search path for target Mono because files in some directories may conflict with libraries in implicit directories:
link library [libopencv_videostab.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_video.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_superres.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_stitching.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_photo.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ocl.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_objdetect.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ml.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_legacy.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_imgproc.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_highgui.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_gpu.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_flann.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_features2d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_core.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_contrib.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_calib3d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
Some of these libraries may not be found correctly. Call Stack (most recent call first): CMakeLists.txt:61 (rosbuild_add_executable)
CMake Warning at /opt/ros/indigo/share/ros/core/rosbuild/public.cmake:509 (add_executable): Cannot generate a safe linker search path for target MonoAR because files in some directories may conflict with libraries in implicit directories:
link library [libopencv_videostab.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_video.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_superres.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_stitching.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_photo.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ocl.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_objdetect.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_ml.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_legacy.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_imgproc.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_highgui.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_gpu.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_flann.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_features2d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_core.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_contrib.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
link library [libopencv_calib3d.so.2.4.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
Some of these libraries may not be found correctly. Call Stack (most recent call first): CMakeLists.txt:70 (rosbuild_add_executable)
-- Generating done -- Build files have been written to: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build gaurav@gaurav-HP-Z420-Workstation:~/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build$
And when I make it
-- Generating done
-- Build files have been written to: /home/gaurav/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build
gaurav@gaurav-HP-Z420-Workstation:~/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build$ make
[ 0%] Built target rospack_genmsg_libexe
[ 0%] Built target rosbuild_precompile
make[2]: No rule to make target /usr/lib/x86_64-linux-gnu/libopencv_video.so.2.4.8', needed by
../RGBD'. Stop.
make[1]: [CMakeFiles/RGBD.dir/all] Error 2
make: *** [all] Error 2
gaurav@gaurav-HP-Z420-Workstation:~/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build$
Please guide me how can I solve this issue
I tried every possible solution. but still unsuccessful.
@gs14iitbbs In my original post I wasn't getting errors, I was getting warnings. I think you may have better luck at the Official RTAB-Map Forums
You may need to clean up your makefiles in src directory
@jacksonkr what was the solution ? How do you fix your LD_LIBRARY_PATH ?
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
If this is shown:
config: /usr/lib/x86_64-linux-gnu/cmake/opencv4
You can add this code to change OpenCV_DIR:
SET(OpenCV_DIR /usr/local/lib/cmake/opencv4/) # 设置OpenCV_DIR
Hey @cgm-free
message(STATUS "OpenCV library status:") message(STATUS " config: ${OpenCV_DIR}") message(STATUS " version: ${OpenCV_VERSION}") message(STATUS " libraries: ${OpenCV_LIBS}") message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
I tried this in my cmake list and the output is :
OpenCV library status: -- config: /usr/local/lib/cmake/opencv4 -- version: 4.2.0 -- libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio -- include path: /usr/local/include/opencv4
(opencv dir is already being shown as /usr/local/lib/cmake/opencv4) any suggestions, what should i do?
here is the terminal screenshot:
You can ignore the warning if the opencv version built from source is the same version than the system version.
@matlabbe oh okay thanks
os: ubuntu 14.04.5 x86_64 kernel: 4.4.0-46-generic rtabmap-ros: 0.11.8-56-gea85929 rtabmap: 0.11.8 opencv: 2.4.8 [without nonfree] pcl: 1.7.1 +freenect +stereo1394 +octomap
It's building and running fine but I'm getting some crazy warnings. Can these be ignored?