0

Rosanswers logo

I am building a hardware interface for my robot using the Dave Coleman's template package ros_control_boilerplate

I am having problems building my package. Relevant snippets of my CMakeLists.txt look like:

include_directories(include ${catkin_INCLUDE_DIRS})

add_library(nymble_hw_interface src/nymble_hw_interface.cpp) target_link_libraries(nymble_hw_interface ${catkin_LIBRARIES})

add_executable(nymble_hw_control_loop src/nymble_hw_control_loop.cpp) target_link_libraries(nymble_hw_control_loop nymble_hw_interface generic_hw_control_loop ${catkin_LIBRARIES})

install(TARGETS
nymble_hw_interface LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

install(TARGETS nymble_hw_control_loop LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )

install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

On running catkin_make, I am getting the error

/usr/bin/ld: cannot find -lgeneric_hw_control_loop
collect2: error: ld returned 1 exit status
make[2]: *** [/home/rohin/catkin_ws/devel/lib/hardware/nymble_hw_control_loop] Error 1
make[1]: *** [nymblebot/hardware/CMakeFiles/nymble_hw_control_loop.dir/all] Error 2
make: *** [all] Error 2

I am at a loss to understand why my generic_hw_control_loop library is not being linked when it is an installed library under the package ros_control_boilerplate.

Also I have listed ros_control_boilerplate as a build and run dependency in my package.xml

The executable I'm building contains :

#include <ros_control_boilerplate/generic_hw_control_loop.h>

Originally posted by rohin on ROS Answers with karma: 99 on 2016-06-24

Post score: 0

1 Answers1

0

Rosanswers logo

Issue solved.

I had messed some of my files. Hence catkin was looking in the wrong directory.


Originally posted by rohin with karma: 99 on 2016-06-25

This answer was ACCEPTED on the original site

Post score: 0