leggedrobotics / darknet_ros

YOLO ROS: Real-Time Object Detection for ROS
BSD 3-Clause "New" or "Revised" License
2.23k stars 1.19k forks source link

catkin_make error (about opencv) #34

Closed wang19950602 closed 6 years ago

wang19950602 commented 7 years ago

Hello, I got a little problem with catkin_make. I use ubuntu 14.04 , ROS:indigo , gcc version 4.8.4 When running 'catkin_make -DCMAKE_BUILD_TYPE=Release',I encounter a problem: catkin_make error The result shows that undefined reference to several opencv functions. May I ask you how to fix this problem? Thank you

floft commented 7 years ago

In src/darknet_ros/darknet_ros/CMakeLists.txt: find the target_link_libraries and add ${OpenCV_LIBS} to the list (src)

Edit: Nope. Don't do that. That ends up seg faulting?

floft commented 7 years ago

Okay, so I'm on indigo and this appears to work:

cd src/
git clone https://github.com/superjax/cv3_bridge

In src/darknet_ros/darknet_ros/CMakeLists.txt:

Achllle commented 7 years ago

The fix by @floft worked on Kinetic, you have to additionally go into package.xml in darknet_ros and change cv_bridge to cv3_bridge.

joyyang1215 commented 6 years ago

Add ${OpenCV_LIBS} and it works. Thanks!

araster1010 commented 6 years ago

I have same problem as you. I tried cv3_bridge, but it doesn't work.

In the CMakelists.txt, there are 4 target_link_libraries. Should I add ${OpenCV_LIBS} all of them?

Could you tell me more detail about this?

mbjelonic commented 6 years ago

You can have a look in the CMakeLists.txt of the branch devel/threads. I fixed it there. I will also merge this branch soon because the detection is much faster on this branch.

On 21 Jan 2018, at 03:27, araster1010 notifications@github.com wrote:

I have same problem as you. I tried cv3_bridge, but it doesn't work.

In the CMakelists.txt, there are 4 target_link_libraries. Should I add ${OpenCV_LIBS} all of them?

Could you tell me more detail about this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mbjelonic commented 6 years ago

Merged the branch devel/threads.