cartographer安装的常见错误
CMAKE_CXX_FLAGS错误
把错误信息完整打到error1.log
catkin_make_isolated --install --use-ninja >> error1.log
查看第一个错误
error: #error "C++ versions less than C++11 are not supported."
在cartographer下CMakeLists.txt 中添加CMAKE_CXX_FLAGS声明
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
# Compiler-specific C++11 activation.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
else ()
message(FATAL_ERROR "Your C++ compiler does not support C++11.")
endif ()
protoc 版本错误
error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
解决办法:
这个错误说的是protoc的版本要求老版本,你可以先使用命令:
$ protoc --version
如果不是官网要求的3.4.0,则删除原来版本
重新运行
src/cartographer/scripts/install_proto3.sh
如果不行,则修改install_proto3.sh中的版本号,尝试不同版本
pcl相关
错误一
Could not find a package configuration file provided by "PCL" with any of the following names
错误原因是没有安装pcl,可以安装pcl1.7,切不可安装pcl1.9,谨记。。。
sudo apt-get install libpcl-dev
或者
sudo apt-get install libpcl1.7
错误二
Could not find a package configuration file provided by "pcl_conversions"
需要安装ros的pcl_conversions包
sudo apt-get install ros-kinetic-pcl-ros
sudo apt-get install ros-kinetic-pcl-conversions