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

catkin_make opencv version conflict.

asked 2020-02-20 03:10:20 -0600

jahim44229 gravatar image

updated 2020-02-20 04:08:57 -0600

gvdhoorn gravatar image

Hello everyone ; When I write catkin_make it gives such a warning.

/usr/bin/ld: warning: libopencv_core.so.4.2, needed by /usr/local/lib/libopencv_highgui.so.4.2.0, may conflict with libopencv_core.so.3.2.

I installed opencv with sudo apt and then I installed it from source. How can i fix the warning ?

Thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-02-20 08:22:08 -0600

prefpkg21 gravatar image

In the CMAKE lists txt file you can specify the version your package should use.

In find_package() command specify the version you need:

find_package(OpenCV 4.2.0 REQUIRED)

edit flag offensive delete link more

Comments

Normally this was the case;

set(OpenCV_DIR /usr/local/lib/cmake/opencv4)

find_package(catkin REQUIRED COMPONENTS

  rospy

  roscpp

  OpenCV

  message_filters

)

When I type OpenCV 4.2.0 , I get an error.(catkin_make error)

jahim44229 gravatar image jahim44229  ( 2020-02-20 09:00:12 -0600 )edit

add a separate find_package() underneath not as a COMPONENT. Makesure your cmake modules path is set

prefpkg21 gravatar image prefpkg21  ( 2020-02-20 09:32:04 -0600 )edit

Like this ?

set(OpenCV_DIR /usr/local/lib/cmake/opencv4)

find_package(catkin REQUIRED COMPONENTS

  cv_bridge

  message_filters

  roscpp

  rospy

  sensor_msgs

  std_msgs

)

find_package(OpenCV 4.2.0 REQUIRED)
jahim44229 gravatar image jahim44229  ( 2020-02-25 07:16:59 -0600 )edit

I get the same warning again.

jahim44229 gravatar image jahim44229  ( 2020-02-27 08:25:05 -0600 )edit

How Ros finds OpenCV 3.2. I didn't even write it in the CMakeList.

jahim44229 gravatar image jahim44229  ( 2020-02-27 08:26:15 -0600 )edit

I' wondering this too.. but in windows!

wgengland gravatar image wgengland  ( 2020-03-24 13:39:08 -0600 )edit

@jahim44229 I'm facing now the same warning. I'm using opencv 4.5.1 but I found out that cv_bridge recommended version for ros melodic is the 3.2. Check here. Maybe that is why ROS finds 3.2 directly. I'm trying to make my node work fully with 3.2

Spyros gravatar image Spyros  ( 2021-03-08 08:54:11 -0600 )edit
0

answered 2021-06-10 03:58:49 -0600

aserbremen gravatar image

A simple solution is to download a suitable version of vision_opencv from https://github.com/ros-perception/vis.... Then extract the contents (containing some packages cv_bridge image_geometry opencv_tests vision_opencv) to a folder called vision_opencv of your src folder in your catkin workspace.

Now catkin_make or catkin build your workspace and the necessary ros opencv packages will compile and link against the local vision_opencv folder. You might need to clean your workspace before that.

edit flag offensive delete link more

Comments

I tried this way, but it's not solved :/ catkin show me this error :

Elektron97 gravatar image Elektron97  ( 2021-07-11 11:04:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-02-20 03:10:20 -0600

Seen: 3,026 times

Last updated: Feb 20 '20