Linking CXX executable error-- /usr/bin/ld: cannot find
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>