error: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’

1、报错

编译(catkin build) svo_pro_ws时,报错

/opt/ros/melodic/include/pcl_ros/point_cloud.h:303:27: error: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’ [-Werror]
  303 |     constexpr static bool pcl_uses_boost = true;

2、问题根因

rpg_svo_pro_open - Github Plus

CMake的版本太低,gcc/g++版本不合适

需要 CMake 3.21.4gcc/g++ 7.5.0

3、解决方法

  1. upgraded CMake from 3.10 to 3.21.4
  2. 打开新终端,确认CMake版本: cmake --version
  3. 将gcc/g++切换到7.5.0的版本
  4. 删除svo_pro_ws中所有的中间文件(一定要),并在该新终端中重新编译:catkin build

猜你喜欢

转载自blog.csdn.net/weixin_37950717/article/details/125221677