cartographer 编译时提示 c++ 版本错误

c++版本错误

在cartographer和cartographer_ros编译时都会出现,以此推断,往后所有出现类似情况,都可以通过指定C++版本解决。

错误提示

/usr/local/include/absl/base/policy_checks.h:77:2: error: #error "C++ versions less than C++11 are not supported."

#error "C++ versions less than C++11 are not supported." ^

解决方法

在cartographer/CMakeLists.txt中加入“add_compile_options(-std=c++11)"指定c++版本
也可以添加"set(CMAKE_CXX_STANDARD 11)"到CMakeLists.txt中。

你可能感兴趣的:(c++,开发语言)