CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:305 (message): catkin_package() include dir 'include' does not exist relative to '/home/yme/ros_ws/src/robot_slam' Call Stack (most recent call first): /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) robot_slam/CMakeLists.txt:111 (catkin_package) -- Configuring incomplete, errors occurred! See also "/home/yme/ros_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/yme/ros_ws/build/CMakeFiles/CMakeError.log".
时间: 2023-07-08 14:48:21 浏览: 303
这个错误是由于在`robot_slam`包的`CMakeLists.txt`文件中,没有正确设置`include_directories`指令,导致CMake无法找到`include`文件夹。要解决这个错误,您可以按照以下步骤进行操作:
1. 确保您的`robot_slam`包中有一个名为`include`的文件夹,其中包含所有的头文件。
2. 打开`robot_slam`包的`CMakeLists.txt`文件。
3. 在文件顶部添加以下行:
```
include_directories(include)
```
4. 确保您的`catkin_package`指令设置正确,其中包括正确的依赖项和版本号。
5. 重新编译您的工作空间,看看是否成功。
如果您在执行上述步骤后仍然遇到问题,请检查`/home/yme/ros_ws/build/CMakeFiles/CMakeError.log`文件,看看是否有其他错误信息,以帮助您进一步诊断问题。
相关问题
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:116 (message)
引用<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:116 (message):catkin_package](https://blog.csdn.net/qq_45950023/article/details/121816434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [执行caktin_make时候,出现错误:CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package....](https://blog.csdn.net/qq_33876441/article/details/115770990)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
出现错误:CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:116os/melodic/share/catkin/cmake/catkin_package.cmake:100
这个错误是由CMake在构建ROS项目时出现的。根据错误信息,可能是在catkin_package.cmake文件的第116行或第100行出现了问题。
要解决这个错误,可以尝试以下几个步骤:
1. 检查CMakeLists.txt文件中是否有语法错误或者缺少必要的依赖项。
2. 确保你的ROS环境正确安装并设置好了。
3. 检查catkin_package.cmake文件的相关行,看看是否有错误或者缺少必要的参数。
如果以上步骤都没有解决问题,可以尝试搜索相关错误信息,查看其他人是否遇到过类似的问题,并找到解决方案。
阅读全文