ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Instead of

target_link_libraries(${PROJECT_NAME}
   StaticLib
 )

try

target_link_libraries(${PROJECT_NAME}
   ${StaticLib_LIBRARIES}
 )

Another option if that doesn't work is check the variable ${${PROJECT_NAME}_FOUND_BUILD_DEPENDS} before / after the ament_auto_add_library call.

If StaticLib is not in there, you might be able to add ament_target_dependencies(${PROJECT_NAME} StaticLib)

Instead of

target_link_libraries(${PROJECT_NAME}
   StaticLib
 )

try

target_link_libraries(${PROJECT_NAME}
   ${StaticLib_LIBRARIES}
 )

Another option if that doesn't work is check the variable ${${PROJECT_NAME}_FOUND_BUILD_DEPENDS} before / after the ament_auto_add_library call.

If StaticLib is not in there, you might be able to add ament_target_dependencies(${PROJECT_NAME} StaticLib)

Edit:

It seems like you have found your answer for the time being, which was you were successfully linking to it but there might be some missing dependency inside of the library when the object is created.

Out of curiosity, are you building this library and can look at the code or just received a static library to use and did not build it?