紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
ros2 编译时报错 code 2
-
在colon build时 报错了,没有错误,没有警告,但还是编译错误,是为什么
(最上面那行警告跟我编译的这个项目应该没有关系吧,只是提示了个不能大写)
下面是我的cmaklist文件cmake_minimum_required(VERSION 3.5) project(devicectrl) # Default to C99 if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 99) endif() # Default to C++14 if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) # find_package(rclpy REQUIRED) find_package(std_msgs REQUIRED) find_package(agv_interfaces REQUIRED) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # the following line skips the linter which checks for copyrights # uncomment the line when a copyright and license is not present in all source files #set(ament_cmake_copyright_FOUND TRUE) # the following line skips cpplint (only works in a git repo) # uncomment the line when this package is not in a git repo #set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif() ament_package() #**************************************** #设置头文件搜索路径 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include/devicectrl ${CMAKE_CURRENT_SOURCE_DIR}/include/lifter ${CMAKE_CURRENT_SOURCE_DIR}/include/pushbeammotor ${CMAKE_CURRENT_SOURCE_DIR}/include/rmdmotor ${CMAKE_CURRENT_SOURCE_DIR}/include/wireencoder ${CMAKE_CURRENT_SOURCE_DIR}/include ${catkin_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIRS} ) #编译生成静态库 # add_library(lifter_lib src/lifter.cpp) # add_library(pushbeammotor_lib src/pushbeammotor.cpp) # add_library(rmdmotor_lib src/rmdmotor.cpp) # add_library(wireencoder_lib src/wireencoder.cpp) # #将依赖包添加到目标程序(库)中 # ament_target_dependencies(lifter_lib rclcpp) # ament_target_dependencies(pushbeammotor_lib rclcpp) # ament_target_dependencies(rmdmotor_lib rclcpp) # ament_target_dependencies(wireencoder_lib rclcpp) #添加依赖功能包,注意不能是库,库是要链接的 #add_dependencies(bionicfish_lib) #编译生成可执行文件 add_executable(devicectrl src/devicectrl.cpp src/lifter.cpp src/pushbeammotor.cpp src/rmdmotor.cpp src/wireencoder.cpp) #将依赖包添加到目标程序中 ament_target_dependencies(devicectrl rclcpp std_msgs agv_interfaces) #设置库文件搜索路径:在cmake所在文件夹 link_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) #指定目标文件需要链接的库 target_link_libraries( devicectrl lifter_lib pushbeammotor_lib rmdmotor_lib wireencoder_lib ) install(TARGETS devicectrl DESTINATION lib/${PROJECT_NAME})
-
@Zln4ever 错误提示中说明了,你的
Ipc_alam_report
变量使用了大写,应该全为小写