catkin_package() DEPENDS on the catkin package 'roscpp' which must therefore be listed as a run dependency in the package.xml
时间: 2024-04-22 13:27:56 浏览: 135
When using the `catkin_package()` function in your CMakeLists.txt file, if you have a dependency on the 'roscpp' package, it needs to be listed as a run dependency in the package.xml file.
To fix this issue, open the package.xml file of your catkin package and locate the `<run_depend>` section. Add the following line within the `<run_depend>` section:
```xml
<run_depend>roscpp</run_depend>
```
Save the file and rebuild your catkin workspace. This should resolve the warning you mentioned.
相关问题
at /opt/ros/melodic/share/catkin/cmake/catkin_package.cmake:224 (message): catkin_package() DEPENDS on the catkin package 'std_msgs' which must therefore be listed as a run dependency in the package.xml
这个ROS构建错误的提示信息是由于你的ROS包中使用了std_msgs,但是在package.xml中没有将其列为运行依赖项导致的。
解决方法:在你的package.xml文件中添加std_msgs为运行依赖项。你可以将以下代码添加到package.xml文件中的<run_depend>标签中:
```
<run_depend>std_msgs</run_depend>
```
然后重新构建你的ROS包,这个错误就会消失了。
catkin_package() the catkin package 'roscpp' has been find_package()-ed but is not listed as a build dependency in the package.xml
This warning usually occurs when the 'roscpp' package is used in your code, but it is not listed as a build dependency in the package.xml file of your catkin package.
To resolve this issue, you need to add 'roscpp' as a build dependency in the package.xml file. Open the package.xml file of your catkin package and locate the `<build_depend>` section. Add the following line within the `<build_depend>` section:
```
<build_depend>roscpp</build_depend>
```
Save the file and rebuild your catkin workspace. This should resolve the warning.
阅读全文