uos / sick_tim

A ROS driver for the SICK TiM series of laser scanners.
http://wiki.ros.org/sick_tim
47 stars 90 forks source link

undefined reference, empty library #71

Closed Rui-i closed 5 years ago

Rui-i commented 5 years ago

when i try to catkin_make there are error : /home/ubuntu/catkin_ws/devel/lib/libsick_tim_3xx.so: undefined reference to `libusb...." AND my /home/ubuntu/catkin_ws/devel/lib/sick_tim/ file is totally empty.

jspricke commented 5 years ago

Which OS do you use? libusb-1.0-dev is a system dependency and should be resolved through rosdep.

Rui-i commented 5 years ago

Which OS do you use? libusb-1.0-dev is a system dependency and should be resolved through rosdep.

THXHTXHTHXTHXTHXHTHXTHHT I GOT IT so basically i experienced libusb.h no such file or directory, to solve this i installed libusb-1.0-0-dev and when Icatkin_make same error appear so i change my CMakeList.txt from this

add_dependencies(sick_tim_3xx ${PROJECT_NAME}_gencfg ${catkin_EXPORTED_TARGETS})
target_link_libraries(sick_tim_3xx
    ${catkin_LIBRARIES}
    ${libusb_LIBRARIES})

to this

add_dependencies(sick_tim_3xx ${PROJECT_NAME}_gencfg ${catkin_EXPORTED_TARGETS})
target_link_libraries(sick_tim_3xx
    ${catkin_LIBRARIES}
    ${libusb-1.0_LIBRARIES})

then i experienced my error that i said in the issue. I actually realised that i am not supposed to change the CMakeList.txt file. I just have to[ cleaning up the build space first

rm -r build devel
catkin_make

](https://github.com/uos/sick_tim/issues/58#issuecomment-365729106)

BUILD SUCCESSFUL YAYYYY!!!!!!!!!!!!!!!!!! HOPE MY DUMB MISTAKE CAN HELP OTHER PEOPLE TOO ^_^