首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建luabind时出错C2665

创建luabind时出错C2665
EN

Stack Overflow用户
提问于 2015-07-13 23:33:48
回答 2查看 725关注 0票数 4

我使用Lua5.1和Boost 1.58.0来尝试构建luabind-0.7.1-rc1。环境变量都已正确设置。我已经为这个问题找了一个星期的答案,但没有成功。

每当我尝试构建luabind时,我都会得到20个相同的错误:

代码语言:javascript
复制
error C2665: 'boost::operator ==' : none of the 4 overloads could convert all the argument types
s:\luabind-0.7.1-rc1\luabind\object.hpp 542 1

所有错误似乎都是从#undef之前的最后两行抛出的:

代码语言:javascript
复制
// Needed because of some strange ADL issues.

#define LUABIND_OPERATOR_ADL_WKND(op) \
  inline bool operator op( \
      basic_iterator<basic_access> const& x \
    , basic_iterator<basic_access> const& y) \
  { \
      return boost::operator op(x, y); \
  } \
 \
  inline bool operator op( \
      basic_iterator<raw_access> const& x \
    , basic_iterator<raw_access> const& y) \
  { \
      return boost::operator op(x, y); \
  }

  LUABIND_OPERATOR_ADL_WKND(==)
  LUABIND_OPERATOR_ADL_WKND(!=)

#undef LUABIND_OPERATOR_ADL_WKND

下面是一些输出本身(它重复如下):

代码语言:javascript
复制
s:\luabind-0.7.1-rc1\luabind\object.hpp(542): error C2665: 'boost::operator ==' : none of the 4 overloads could convert all the argument types
          s:\boost_1_58_0\boost\function\function_base.hpp(750): could be 'bool boost::operator ==(boost::detail::function::useless_clear_type *,const boost::function_base &)'
          s:\boost_1_58_0\boost\function\function_base.hpp(738): or       'bool boost::operator ==(const boost::function_base &,boost::detail::function::useless_clear_type *)'
          s:\boost_1_58_0\boost\function\function_base.hpp(809): or       'bool boost::operator ==<luabind::detail::basic_iterator<luabind::detail::basic_access>>(Functor,const boost::function_base &)'
          with
          [
              Functor=luabind::detail::basic_iterator<luabind::detail::basic_access>
          ]
          s:\boost_1_58_0\boost\function\function_base.hpp(800): or       'bool boost::operator ==<luabind::detail::basic_iterator<luabind::detail::basic_access>>(const boost::function_base &,Functor)'
          with
          [
              Functor=luabind::detail::basic_iterator<luabind::detail::basic_access>
          ]
          while trying to match the argument list '(const luabind::detail::basic_iterator<luabind::detail::basic_access>, const luabind::detail::basic_iterator<luabind::detail::basic_access>)'

有人对这个问题有洞察力或经验吗?是什么导致了这个错误,我如何修复它,以及如何在将来避免它?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-07-14 02:25:17

您需要使用旧的boost库。luabind 0.7.1来自2008年。在同一年左右尝试一个增强版本。我和luabind 0.8.1和Boost 1.58.0有同样的问题。

在我的例子中,1.55.0工作得很好,它与vs2013一起工作。显然,较早版本的Boost需要为vs2013进行修补。

票数 1
EN

Stack Overflow用户

发布于 2015-09-23 14:59:21

现在(2015年9月)您可以切换到luabind 0.9,而不是使用0.7版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31395223

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档