c++boostlualuabind

error C2665 when building luabind


I'm using Lua5.1 and Boost 1.58.0 to try and build luabind-0.7.1-rc1. Environment variables are all set properly. I've been searching for an answer for this for about a week now without success.

Whenever I try to build luabind I get 20 of the same error:

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

All the errors seem to be thrown from the last two lines before #undef:

// 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

And here's some of the output itself(it repeats like this):

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>)'

Does anyone have insight or experience with this problem? What could be causing this error, how can I fix it, and how can I avoid it in the future?


Solution

  • You need to use an older boost library. luabind 0.7.1 is from 2008. Try a Boost version from around the same year. I had the exact same problem with luabind 0.8.1 and Boost 1.58.0.

    In my case 1.55.0 worked great and it works with vs2013. Apparently older versions of Boost needed to be patched for vs2013.