ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ROS unable to find opencv libraries

asked 2013-03-03 09:32:07 -0500

AdrianPeng gravatar image

updated 2013-03-04 05:30:18 -0500

I am trying to build image_view from source on Gumstix Overo which has ros groovy running on linaro.

However, one of dependencies of image_view -- opencv2 cannot be resolved in system dependency. So I cannot use rosdep to install opencv2.

Then I went to http://opencv.org/downloads.html and downloaded version 2.4.3 and followed instruction to install OpenCV.

However, when I make image_view, I got the following error.

[rosmake-0] Starting >>> image_view [ make ]                                    
[ rosmake ] Last 40 linesage_view: 346.6 sec ]       [ 1 Active 17/18 Complete ]
{-------------------------------------------------------------------------------
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `~Mat':
  /usr/local/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `~CvBridge':
  /root/catkin_ws/src/vision_opencv-fuerte-devel/cv_bridge/include/cv_bridge/CvBridge.h:72: undefined reference to `cvReleaseImageHeader'
  /root/catkin_ws/src/vision_opencv-fuerte-devel/cv_bridge/include/cv_bridge/CvBridge.h:77: undefined reference to `cvReleaseImage'
  /root/catkin_ws/src/vision_opencv-fuerte-devel/cv_bridge/include/cv_bridge/CvBridge.h:72: undefined reference to `cvReleaseImageHeader'
  /root/catkin_ws/src/vision_opencv-fuerte-devel/cv_bridge/include/cv_bridge/CvBridge.h:77: undefined reference to `cvReleaseImage'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `~Mat':
  /usr/local/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
  /usr/local/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `~Mat_':
  /usr/local/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `~Mat':
  /usr/local/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
  /usr/local/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `StereoView::saveImage(char const*, cv::Mat const&)':
  /root/catkin_ws/src/image_pipeline-electric/image_view/src/nodes/stereo_view.cpp:499: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
  /root/catkin_ws/src/image_pipeline-electric/image_view/src/nodes/stereo_view.cpp:499: undefined reference to `cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `CvBridge':
  /root/catkin_ws/src/vision_opencv-fuerte-devel/cv_bridge/include/cv_bridge/CvBridge.h:66: undefined reference to `cvCreateImageHeader'
  /root/catkin_ws/src/vision_opencv-fuerte-devel/cv_bridge/include/cv_bridge/CvBridge.h:66: undefined reference to `cvCreateImageHeader'
  CMakeFiles/stereo_view.dir/src/nodes/stereo_view.cpp.o: In function `StereoView':
  /root/catkin_ws/src/image_pipeline-electric/image_view/src/nodes/stereo_view.cpp:377: undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
  /root/catkin_ws/src/image_pipeline-electric/image_view/src/nodes/stereo_view.cpp:378: undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
  /root/catkin_ws/src/image_pipeline-electric/image_view/src/nodes/stereo_view.cpp:379: undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
  /root/catkin_ws/src/image_pipeline-electric/image_view/src/nodes/stereo_view.cpp:380: undefined reference to `cvSetMouseCallback'
  /root/catkin_ws/src/image_pipeline-electric/image_view/src ...
(more)
edit retag flag offensive close merge delete

Comments

I don't understand why if you are in groovy the compilation process is made in electric/fuerte (see the file path in each error e.g. "vision_opencv-FUERTE-devel"). Have you checked out the git branch to groovy?

Miquel Massot gravatar image Miquel Massot  ( 2013-03-05 11:00:25 -0500 )edit

Because I have problem using catkin_make, catkin_make cannot find groovy package in source folder. I asked a question about that before, this is the link http://answers.ros.org/question/54539/help-with-catkin_make-on-an-arm/. However, the problem haven't solved. That's why I use rosmake instead.

AdrianPeng gravatar image AdrianPeng  ( 2013-03-05 14:07:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-03 12:42:06 -0500

Try adding the line FIND_PACKAGE(OpenCV REQUIRED) to your CmakeList.txt.

edit flag offensive delete link more

Comments

I updated the output after adding "FIND_PACKAGE(OpenCV REQUIRED)" to CMakeList.txt of image_view. I guess there are some problem in cv_bridge package.

AdrianPeng gravatar image AdrianPeng  ( 2013-03-04 05:32:00 -0500 )edit

This solved it for me

tobinfinity gravatar image tobinfinity  ( 2018-02-24 05:37:20 -0500 )edit

Question Tools

Stats

Asked: 2013-03-03 09:32:07 -0500

Seen: 3,070 times

Last updated: Mar 04 '13