ROS添加外部库

因为最后毕设都要用英文呈现,用英文记录,就当练习英文啦~

I want to add a external library to my current package.
I have tried few methods from the internet and only succeed by following approach.
In CMakeList.txt located in your package:

include_directories(
  ${catkin_INCLUDE_DIRS}
  /home/yummy/catkin_ws/src/libfranka/include
)
link_directories(/home/yummy/catkin_ws/src/libfranka)

#using here
add_executable(collision_detection_pub scripts/collision_detection.cpp)
target_link_libraries(collision_detection_pub ${catkin_LIBRARIES})

add_library or add_package : Find the specified library file

include_directories : Specify additional locations of header files

link_directories : Specify the (third-party) searching path for linker

target_link_libraries : Specify the linkers which target needs

发布了16 篇原创文章 · 获赞 1 · 访问量 273

猜你喜欢

转载自blog.csdn.net/weixin_45366564/article/details/100067923