编译g2o文件时出错-error: ‘tuple_size_v’ is not a member of ‘std’; did you mean ‘tuple_size’?

G2o 编译是会报以下错误:

error: ‘tuple_size_v’ is not a member of ‘std’; did you mean ‘tuple_size’?

/usr/local/include/g2o/stuff/tuple_tools.h: In function ‘void g2o::tuple_apply_i(F&&, T&, int)’:
/usr/local/include/g2o/stuff/tuple_tools.h:42:46: error: ‘tuple_size_v’ is not a member of ‘std’; did you mean ‘tuple_size’?
   42 |       f, t, i, std::make_index_sequence>>());
      |                                              ^~~~~~~~~~~~
      |                                              tuple_size
/usr/local/include/g2o/stuff/tuple_tools.h:42:46: error: ‘tuple_size_v’ is not a member of ‘std’; did you mean ‘tuple_size’?
   42 |       f, t, i, std::make_index_sequence>>());
      |                                              ^~~~~~~~~~~~
      |                                              tuple_size
/usr/local/include/g2o/stuff/tuple_tools.h:42:73: error: template argument 1 is invalid
   42 |       f, t, i, std::make_index_sequence>>());
      |                                                                         ^~
/usr/local/include/g2o/stuff/tuple_tools.h:42:77: error: expected primary-expression before ‘)’ token
   42 |       f, t, i, std::make_index_sequence>>());
      |                                                                             ^

编译g2o文件时出错-error: ‘tuple_size_v’ is not a member of ‘std’; did you mean ‘tuple_size’?_第1张图片

修改方法:

将原有的C++标准 改为14或17  根据ubuntu的版本

# set(CMAKE_CXX_FLAGS "-std=c++14 -O2 ${SSE_FLAGS} -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")

set(CMAKE_CXX_FLAGS "-std=c++17 -O2 ${SSE_FLAGS} -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")

你可能感兴趣的:(QT,Creator+PCL问题解决,g2o,c++,ubuntu)