error: Cannot find source file: RadarCommon/radar_result.h Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc解决
时间: 2023-11-06 21:05:55 浏览: 59
这个错误提示是编译器找不到 `RadarCommon/radar_result.h` 这个头文件,可能是头文件路径设置不正确或者文件确实不存在。
你需要检查一下编译器的头文件搜索路径是否包含 `RadarCommon` 目录,如果没有,需要在编译选项中加入 `-I` 参数,指定头文件搜索路径。
例如,如果 `RadarCommon` 目录在当前目录下,可以在编译命令中加入 `-I./RadarCommon` 参数。
另外,还需要确认一下这个头文件是否真的存在,可以检查一下路径是否正确,或者使用文件管理器搜索一下。如果文件确实不存在,需要先创建该文件并编写相应的代码。
相关问题
CMake Error at my_package/CMakeLists.txt:206 (add_executable): Cannot find source file: src/my_package.cpp Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx CMake Error at my_package/CMakeLists.txt:206 (add_executable): No SOURCES given to target: my_package CMake Generate step failed. Build files cannot be regenerated correctly. Invoking "cmake" failed
这个错误提示说明在 `my_package` 目录下的 `CMakeLists.txt` 文件中,第 206 行的 `add_executable` 命令没有找到源文件 `src/my_package.cpp`。可能是文件不存在或路径不正确。
你可以检查一下 `src` 目录是否存在,并且里面是否有 `my_package.cpp` 文件。如果文件确实存在,你可以尝试将 `add_executable` 命令修改为:
```cmake
add_executable(my_package src/my_package.cpp)
```
这样 cmake 就能够正确找到源文件并生成可执行文件了。
CMake Error at my_package/CMakeLists.txt:206 (add_executable): Cannot find source file: src/my_node.cpp Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx CMake Error at my_package/CMakeLists.txt:206 (add_executable): No SOURCES given to target: my_node CMake Generate step failed. Build files cannot be regenerated correctly. Invoking "cmake" failed
这个错误是由于 CMake 无法找到 `src/my_node.cpp` 文件导致的。请检查您的工程目录结构以确保该文件的存在。
如果该文件确实存在,请检查您的 CMakeLists.txt 文件中是否正确指定了源文件。您可以参考下面的示例代码:
```
add_executable(my_node src/my_node.cpp)
```
这将在 `src` 目录中查找 `my_node.cpp` 文件,并将其添加为可执行文件 `my_node` 的源文件。