Eigen3 相关报错:EIGEN_CONSTEXPR EIGEN_HAS_CONSTEXPR EIGEN_USING_STD

/usr/local/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h:550:5: error: ‘EIGEN_CONSTEXPR’ does not name a type; did you mean ‘EIGEN_HAS_CONSTEXPR’?
  550 |     EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
      |     ^~~~~~~~~~~~~~~
      |     EIGEN_HAS_CONSTEXPR
/usr/local/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h:551:5: error: ‘EIGEN_CONSTEXPR’ does not name a type; did you mean ‘EIGEN_HAS_CONSTEXPR’?
  551 |     EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
      |     ^~~~~~~~~~~~~~~
      |     EIGEN_HAS_CONSTEXPR
      …………
     /usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:426:3: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  426 |   EIGEN_USING_STD(abs);
      |   ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:426:3: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h: In static member function ‘static void Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 3, false>::computeRoots(const MatrixType&, Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 3, false>::VectorType&)’:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:597:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  597 |     EIGEN_USING_STD(sqrt)
      |     ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:597:26: error: expected ‘;’ before ‘EIGEN_USING_STD’
  597 |     EIGEN_USING_STD(sqrt)
      |                          ^
      |                          ;
  598 |     EIGEN_USING_STD(atan2)
      |     ~~~~~~~~~~~~~~~       
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:613:27: error: ‘s_inv3’ was not declared in this scope
  613 |     Scalar c2_over_3 = c2*s_inv3;
      |                           ^~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h: In static member function ‘static bool Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 3, false>::extract_kernel(Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 3, false>::MatrixType&, Eigen::Ref<typename SolverType::RealVectorType>, Eigen::Ref<typename SolverType::RealVectorType>)’:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:636:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  636 |     EIGEN_USING_STD(abs);
      |     ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:637:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  637 |     EIGEN_USING_STD(sqrt);
      |     ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h: In static member function ‘static void Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 2, false>::computeRoots(const MatrixType&, Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 2, false>::VectorType&)’:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:751:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  751 |     EIGEN_USING_STD(sqrt);
      |     ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h: In static member function ‘static void Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 2, false>::run(SolverType&, const MatrixType&, int)’:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:761:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  761 |     EIGEN_USING_STD(sqrt);
      |     ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:762:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  762 |     EIGEN_USING_STD(abs);
      |     ^~~~~~~~~~~~~~~
In file included from /usr/local/include/eigen3/Eigen/Eigenvalues:36,
                 from /usr/local/include/eigen3/Eigen/Dense:7,
                 from /home/orinnx/Multi-robot-SLAM/A-LOAM/src/A-LOAM/src/laserMapping.cpp:53:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h:550:5: error: ‘EIGEN_CONSTEXPR’ does not name a type; did you mean ‘EIGEN_HAS_CONSTEXPR’?
  550 |     EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); }
      |     ^~~~~~~~~~~~~~~
      |     EIGEN_HAS_CONSTEXPR
/usr/local/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h:551:5: error: ‘EIGEN_CONSTEXPR’ does not name a type; did you mean ‘EIGEN_HAS_CONSTEXPR’?
  551 |     EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); }
      |     ^~~~~~~~~~~~~~~
      |     EIGEN_HAS_CONSTEXPR
In file included from /usr/local/include/eigen3/Eigen/Eigenvalues:39,
                 from /usr/local/include/eigen3/Eigen/Dense:7,
                 from /home/orinnx/Multi-robot-SLAM/A-LOAM/src/A-LOAM/src/laserMapping.cpp:53:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h: In member function ‘Eigen::SelfAdjointEigenSolver<MatrixType>& Eigen::SelfAdjointEigenSolver<_MatrixType>::compute(const Eigen::EigenBase<OtherDerived>&, int)’:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:426:3: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  426 |   EIGEN_USING_STD(abs);
      |   ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:426:3: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h: In static member function ‘static void Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 3, false>::computeRoots(const MatrixType&, Eigen::internal::direct_selfadjoint_eigenvalues<SolverType, 3, false>::VectorType&)’:
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:597:5: error: there are no arguments to ‘EIGEN_USING_STD’ that depend on a template parameter, so a declaration of ‘EIGEN_USING_STD’ must be available [-fpermissive]
  597 |     EIGEN_USING_STD(sqrt)
      |     ^~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:597:26: error: expected ‘;’ before ‘EIGEN_USING_STD’
 

与Eigen的安装方式路径有关,更改相关cpp文件中包含头文件的路径:

#include <eigen3/Eigen/Dense>
------更改为下面这个--------
#include<Eigen/Dense> 
  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值