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

1. Report an error

When compiling (catkin build) svo_pro_ws, an error is reported

/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. Root cause of the problem

rpg_svo_pro_open - Github Plus

The CMake version is too low and the gcc/g++ version is inappropriate.

need CMake 3.21.4andgcc/g++ 7.5.0

3. Solution

  1. upgraded CMake from 3.10 to 3.21.4
  2. Open a new terminal and confirm the CMake version:cmake --version
  3. 7.5.0The version to switch gcc/g++ to
  4. Delete svo_pro_wsall intermediate files (be sure) and recompile in this new terminal:catkin build

Acho que você gosta

Origin blog.csdn.net/weixin_37950717/article/details/125221677
Recomendado
Clasificación