有问题可以指出留言,我们一起进步!
copy过来一个大佬的代码,编译竟然出现了没遇见过的问题
fastSLAMproject/src/gmapping/openslam_gmapping/scanmatcher/CMakeFiles/scanmatcher.dir/eig3.cpp.o
/home/ros/roslianxi/fastSLAMproject_ws/src/fastSLAMproject/src/gmapping/openslam_gmapping/scanmatcher/scanmatcher.cpp:6:21: fatal error: ros/ros.h: 没有那个文件或目录
主要问题是:
fatal error: ros/ros.h: 没有那个文件或目录
解决方案为,在出错的文件的包下的CMakeLists.txt文件里,加上
find_package(catkin REQUIRED COMPONENTS
roscpp
)
include_directories(include ${catkin_INCLUDE_DIRS} )
roscpp和${catkin_INCLUDE_DIRS}缺一不可啊