Sophus编译报错

问题描述

编译Sophus时,遇到如下错误

Sophus/sophus/so2.hpp:106:40: error: ‘ScalarBinaryOpTraits’ in namespace ‘Eigen’ does not name a template type
using ReturnScalar = typename Eigen::ScalarBinaryOpTraits<

解决方法

Sophus需要3.3以上的版本,而我装的是3.1的版本,重新安装后编译通过

如何查看eigen版本

cat /usr/include/eigen3/Eigen/src/Core/util/Macros.h

#或者

cat /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h

该头文件的前面几行有相关版本信息,如下

$ cat /usr/local/include/eigen3/Eigen/src/Core/util/Macros.h
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_MACROS_H
#define EIGEN_MACROS_H

#define EIGEN_WORLD_VERSION 3
#define EIGEN_MAJOR_VERSION 3
#define EIGEN_MINOR_VERSION 1
//这里版本即为3.3.1
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值