lagadic / visp_ros

A basket of generic ros nodes based on ViSP library
GNU General Public License v2.0
42 stars 33 forks source link

Unable to build tutorial-ros-grabber "undefined reference to cv::Mat::Mat()" #23

Closed giulio-pugliese closed 2 years ago

giulio-pugliese commented 3 years ago

Hi, I'm not able to make the build of tutorial-ros-grabber using make. (Ubuntu 18.04, Ros-Melodic) (Followed the instructions from this Github to install) I get:

~/catkin_ws/src/visp_ros/tutorial/grabber/ros$ make

[ 50%] Linking CXX executable tutorial-ros-grabber /home/giulio/catkin_ws/install/lib/libvisp_ros.so: undefined reference to `cv::Mat::Mat()' collect2: error: ld returned 1 exit status CMakeFiles/tutorial-ros-grabber.dir/build.make:192: recipe for target 'tutorial-ros-grabber' failed make[2]: [tutorial-ros-grabber] Error 1 CMakeFiles/Makefile2:707: recipe for target 'CMakeFiles/tutorial-ros-grabber.dir/all' failed make[1]: [CMakeFiles/tutorial-ros-grabber.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2

I had got the same error when building the whole catkin_ws but since it was just a problem of Franka's tutorial I had removed it from the make list.

fspindle commented 3 years ago

Thanks for your feedback. The issue occurs because ViSP is not build with OpenCV third-party support.

TBD: The CMakeLists.txt file should be changed to detect that VISP_HAVE_OPENCV is false and then call find_package(OpenCV).

giulio-pugliese commented 3 years ago

Thank you. How can I add OpenCV third-party support to my current installation?

If I already have OpenCV as a package, which CMakeLists.txt should I modify to get it working with it as you said? And how should I modify it?

fspindle commented 3 years ago

How did you install ViSP ?

fspindle commented 2 years ago

@giulio-pugliese Any update ?

On my side I'm unable to reproduce the issue, even when ViSP is not build with OpenCV support.

giulio-pugliese commented 2 years ago

Hi @fspindle,

I got around the issue, it was a problem of installing only one instance of ViSP and managing the third parties from there: https://github.com/lagadic/visp/issues/930#issuecomment-929370416.

Anyway I didn't use ViSP_ROS much, I just used the main ViSP libraries in ROS nodes.