【发布时间】:2015-10-02 10:00:45
【问题描述】:
我正在使用 Lua5.1 和 Boost 1.58.0 来尝试构建 luabind-0.7.1-rc1。环境变量都设置正确。我一直在寻找这个问题的答案大约一个星期,但没有成功。
每当我尝试构建 luabind 时,都会遇到 20 个相同的错误:
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 之前的最后两行抛出的:
// 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
这是一些输出本身(它像这样重复):
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>)'
有人对这个问题有见解或经验吗? 什么可能导致此错误,我该如何解决它,以及将来如何避免它?
【问题讨论】:
-
“环境变量都设置正确” 不是一个有用的说法:让我们来判断什么设置正确,什么不正确,因为你没有能够确定出乎意料的错误!如果您认为环境变量很重要,请向我们展示环境变量。