执行catkin_make时出现的error in code at cmakelist.txt:1:parse error...........的解决办法

运行catkin_make时出现cmake error:error in code at xxxx(路径)/CMakeLists.txt:1:parse error。

-- Configuring incomplete, errors occurred!
See also "/home/pdg/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/pdg/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

出现这种错误的可以尝试用以下三种方法解决:

1.可能是程序找不到PCL的CMake files,可以尝试在CMakeLists.txt中find_package()前添加 set(PCL_DIR /usr/share/pcl-1.8。

2.若是上一方法不行,可以尝试第二种方法,检查一下系统中安装的cmake的版本,是否符合CMakeLists.txt文件中对cmake版本的最低要求(比如我的是cmake_minimum_required(VERSION 2.8.3)),若不符合,可以尝试修改CMakeLists.txt中要求的最低版本(如我的改为2.8);若不行只能升级你已经安装的cmake  的版本。

3.第三种原因可能是CMakeLists.txt中存在语法错误,这就需要你仔细的检查语句,找出错误修改了。

以上的方法只是是我个人遇到这个问题时的解决方法,仅供参考,可能你遇到相同的问题上面的方法不一定能解决。


你可能感兴趣的:(ros,学习)