本人在编译CAMODOCAL工程时遇到了该错误:
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:64:21: error: ‘integer_sequence’ is not a member of ‘std’
struct SumImpl<std::integer_sequence<T, N, Ns...>> {
^~~~~~~~~~~~~~~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:64:21: error: ‘integer_sequence’ is not a member of ‘std’
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:64:46: error: wrong number of template arguments (3, should be 1)
struct SumImpl<std::integer_sequence<T, N, Ns...>> {
^~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:60:8: note: provided for ‘template<class Seq> struct ceres::internal::SumImpl’
struct SumImpl;
^~~~~~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:64:49: error: expected unqualified-id before ‘>’ token
struct SumImpl<std::integer_sequence<T, N, Ns...>> {
^~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:71:21: error: ‘integer_sequence’ is not a member of ‘std’
struct SumImpl<std::integer_sequence<T, N1, N2, Ns...>> {
^~~~~~~~~~~~~~~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:71:21: error: ‘integer_sequence’ is not a member of ‘std’
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:71:51: error: wrong number of template arguments (4, should be 1)
struct SumImpl<std::integer_sequence<T, N1, N2, Ns...>> {
^~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:60:8: note: provided for ‘template<class Seq> struct ceres::internal::SumImpl’
struct SumImpl;
^~~~~~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:71:54: error: expected unqualified-id before ‘>’ token
struct SumImpl<std::integer_sequence<T, N1, N2, Ns...>> {
^~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:78:21: error: ‘integer_sequence’ is not a member of ‘std’
struct SumImpl<std::integer_sequence<T, N1, N2, N3, N4, Ns...>> {
^~~~~~~~~~~~~~~~
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:78:21: error: ‘integer_sequence’ is not a member of ‘std’
归根结底是ceres的版本问题,网上有很多解决办法,对于别的工程可能管用:
修改cmakelists文件中:
set(CMAKE_CXX_FLAGS "-std=c++11")
为:
set(CMAKE_CXX_STANDARD 11)
或者:
set(CMAKE_CXX_STANDARD 14)
详细可见ceres的源代码说明:
https://github.com/ceres-solver/ceres-solver/issues/604
但如果还是不行,比如本人编译CamOdoCal这种老项目,可以将ceres版本退回到1.1.4,感谢网友,详细操作可以见此链接: