我是靠谱客的博主 笑点低百褶裙,这篇文章主要介绍8004.ros2中添加boost依赖库写法,现在分享给大家,希望可以做个参考。

  • **
set(BOOST_ROOT D:/01softInstall/opt_lib/boost_1_72_install)
find_package(Boost 1.72.0 REQUIRED COMPONENTS thread atomic system regex)
if(Boost_FOUND)
## 在win10平台 ros2 版本dashing中 message 打印信息编译报错,注意需要注释掉.
#
message(Boost_INCLUDE_DIRS " ${Boost_INCLUDE_DIRS}")
#
message(Boost_LIBRARY_DIRS " ${Boost_LIBRARY_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
endif()
add_executable(rosmsg_middleware src/main.cpp src/TcpServer.hpp)
target_link_libraries(rosmsg_middleware ${Boost_LIBRARIES})
#只能连接package找到的包.
ament_target_dependencies(rosmsg_middleware rclcpp std_msgs)
#ament_target_dependencies(rosmsg_middleware rclcpp std_msgs Boost)
find_package(Boost REQUIRED COMPONENTS system)
target_link_libraries(your_node ${PROJECT_NAME} ${Boost_LIBRARIES})
ament_export_dependencies(Boost)
ament_export_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})

最后

以上就是笑点低百褶裙最近收集整理的关于8004.ros2中添加boost依赖库写法的全部内容,更多相关8004内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(134)

评论列表共有 0 条评论

立即
投稿
返回
顶部