用vs2015编译okvis时遇到的代码中的语法问题

xdzhangyiy 研究生  2017-11-08 05:22:02
在windows系统中用vs2015编译okvis代码中okvis_multisensor_processing模块的时候,总是报下面的错误,自己做了小小的修改,还是不能编译通过,求c++大神给点修改的建议。
报的错误:
严重性 代码 说明 项目 文件 行
错误 C4430 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int okvis_multisensor_processing details.h 68
错误 C2143 语法错误: 缺少“,”(在“&”的前面) okvis_multisensor_processing details.h 68
错误 C2988 不可识别的模板声明/定义 okvis_multisensor_processing details.h 79
错误 C2238 意外的标记位于“;”之前 okvis_multisensor_processing details.h 79
错误 C2143 语法错误: 缺少“;”(在“&”的前面) okvis_multisensor_processing details.h 79
错误 C2059 语法错误:“&” okvis_multisensor_processing details.h 79
错误 C2334 “{”的前面有意外标记;跳过明显的函数体 okvis_multisensor_processing details.h 88
以下是details.h的代码

// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2009 Hauke Heibel <hauke.heibel@googlemail.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_STL_DETAILS_H
#define EIGEN_STL_DETAILS_H

#ifndef EIGEN_ALIGNED_ALLOCATOR
#define EIGEN_ALIGNED_ALLOCATOR Eigen::aligned_allocator
#endif

namespace Eigen {

// This one is needed to prevent reimplementing the whole std::vector.
template <class T>
class aligned_allocator_indirection : public EIGEN_ALIGNED_ALLOCATOR<T>
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;

template<class U>
struct rebind
{
typedef aligned_allocator_indirection<U> other;
};

aligned_allocator_indirection() {}
aligned_allocator_indirection(const aligned_allocator_indirection& ) : EIGEN_ALIGNED_ALLOCATOR<T>() {}
aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR<T>& ) {}
template<class U>
aligned_allocator_indirection(const aligned_allocator_indirection<U>& ) {}
template<class U>
aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR<U>& ) {}
~aligned_allocator_indirection() {}
};

#ifdef _MSC_VER

// sometimes, MSVC detects, at compile time, that the argument x
// in std::vector::resize(size_t s,T x) won't be aligned and generate an error
// even if this function is never called. Whence this little wrapper.
#define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) \
typename Eigen::internal::conditional< \
Eigen::internal::is_arithmetic<T>::value, \
T, \
Eigen::internal::workaround_msvc_stl_support<T> \
>::type

namespace internal {
template<typename T>
struct workaround_msvc_stl_support : public T
{
workaround_msvc_stl_support() : T() {}

//inline workaround_msvc_stl_support(const T& other) : T(other) {}
workaround_msvc_stl_support(const T& other) : T(other) {}

operator T& () { return *static_cast<T*>(this); }

operator const T& () const { return *static_cast<const T*>(this); }

//template<typename OtherT>
//inline T& operator=(const OtherT& other)
//{ T::operator=(other); return *this; }

template<typename OtherT>
T& operator=(const OtherT& other)
{
T::operator=(other);
return *this;
}

//inline workaround_msvc_stl_support& operator=(const workaround_msvc_stl_support& other)
//{ T::operator=(other); return *this; }
workaround_msvc_stl_support& operator=(const workaround_msvc_stl_support& other)
{
T::operator=(other);
return *this;
}

};

}

#else

#define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) T

#endif

}

#endif // EIGEN_STL_DETAILS_H

求大神给点解决的思路,或者有哪位大神用vs2015编译过okvis的代码,也可以交流一下,是不是我哪些库下的不对。
...全文
134 2 点赞 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xdzhangyiy 2017-11-10
details.h的代码就是上面的代码,它就没有依赖其它的头文件。
  • 打赏
  • 举报
回复
greex 2017-11-09
是否有它自己的头文件没有加正确?
  • 打赏
  • 举报
回复
相关推荐
发帖
C++ 语言
加入

6.0w+

社区成员

C++ 语言相关问题讨论,技术干货分享,前沿动态等
申请成为版主
帖子事件
创建了帖子
2017-11-08 05:22
社区公告
暂无公告