[Error] yaml.h: No such file or directory
时间: 2023-11-17 17:01:53 浏览: 83
这个错误通常是由于缺少yaml-cpp库文件导致的。您可以通过运行以下命令来安装yaml-cpp库文件:sudo apt-get install libyaml-cpp-dev。如果已经安装了yaml-cpp库文件,但仍然出现此错误,则可以尝试在/usr/include目录下创建yaml-cpp文件夹,并将yaml.h文件拷贝到该文件夹中。您可以通过在终端中运行以下命令来完成此操作:sudo mkdir /usr/include/yaml-cpp && sudo cp /usr/include/yaml.h /usr/include/yaml-cpp/yaml.h。
相关问题
kubeadm init --config kubeadm-config.yaml unable to read config from "kubeadm-config.yaml" : open kubeadm-config.yaml: no such file or directory To see the stack trace of this error execute with --v=5 or higher
根据您提供的输出,kubeadm无法找到名为"kubeadm-config.yaml"的配置文件。请确保该文件存在于当前工作目录中,并且您有读取该文件的权限。
您可以通过运行`ls`命令来验证当前目录中是否存在"kubeadm-config.yaml"文件:
```
ls kubeadm-config.yaml
```
如果文件存在,但仍然无法读取,请确保您有足够的权限访问该文件。您可以尝试更改文件的权限或使用`sudo`命令以root用户身份运行`kubeadm init`命令。
另外,请确保您在正确的目录中运行命令。如果"kubeadm-config.yaml"文件不在当前目录中,您需要提供正确的文件路径。
如果问题仍然存在,请尝试使用`--v=5`或更高的日志级别运行命令,以获取更详细的堆栈跟踪信息,以便进一步调查错误原因。
/home/ubuntu/catkin_ws/src/navigation/map_server/src/main.cpp:47:30: fatal error: nav_msgs/LoadMap.h: No such file or directory compilation terminated. CMakeFiles/map_server.dir/build.make:62: recipe for target 'CMakeFiles/map_server.dir/src/main.cpp.o' failed
这个错误提示是说在编译 `map_server` 时,编译器无法找到 `nav_msgs/LoadMap.h` 这个头文件。解决方法是需要在 `CMakeLists.txt` 文件中加入依赖项,使得编译器能够找到该头文件。具体的方法是在 `CMakeLists.txt` 的 `find_package()` 函数中添加 `message_generation` 依赖项,如下所示:
```
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
nav_msgs
message_generation
)
```
然后,在 `CMakeLists.txt` 的 `add_executable()` 函数中,将 `message_generation` 依赖项添加到 `target_link_libraries()` 函数的参数列表中,如下所示:
```
add_executable(map_server
src/main.cpp
)
target_link_libraries(map_server
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${PCL_LIBRARIES}
${YAML_CPP_LIBRARIES}
message_generation
)
```
这样就可以让编译器找到 `nav_msgs/LoadMap.h` 头文件了。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)