KumarRobotics / flea3

ROS driver for flea3/grasshopper3 camera
21 stars 34 forks source link

LibUSB linking problem #9

Closed joanpepcompany closed 8 years ago

joanpepcompany commented 8 years ago

I'm trying to compile the code, but I'm having the following error: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libflycapture.so: undefined reference to libusb_handle_events_timeout_completed' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libflycapture.so: undefined reference tolibusb_hascapability' It seems a linking problem with the library. LibUSB library is installed. Do you know any solutions for this issue? Thanks in advance.

versatran01 commented 8 years ago

Are you using the latest 2.9.3 flycapture sdk? Can you try linking to libusb explicitly in the CMakeLists? Just add usb-1.0 to line 44 and see if it works?

target_link_libraries(
    ${PROJECT_NAME}
    ${catkin_LIBRARIES}
    ${FlyCapture2_LIBRARIES}
    usb-1.0
    )

Also, try running flycap and see if it can successfully recognize and open your camera.

joanpepcompany commented 8 years ago

SOLVED, I've just add usb-1.0 at CMakelists as you propose. Thanks.