c++编译错误(make)问题,怎么弄?

z253642075 2014-12-04 10:38:44
/usr/include/c++/4.8.3/bits/streambuf_iterator.h:172:43: 错误:宏“equal”需要 3 个参数,但只给出了 1 个
equal(const istreambuf_iterator& __b) const ^
/usr/include/c++/4.8.3/bits/streambuf_iterator.h:206:27: 错误:宏“equal”需要 3 个参数,但只给出了 1 个
{ return __a.equal(__b); } ^
/usr/include/c++/4.8.3/bits/streambuf_iterator.h:212:28: 错误:宏“equal”需要 3 个参数,但只给出了 1 个
{ return !__a.equal(__b); }
/usr/include/c++/4.8.3/bits/streambuf_iterator.h:172:7: 错误:expected ‘;’ at end of member declaration
equal(const istreambuf_iterator& __b) const ^
/usr/include/c++/4.8.3/bits/streambuf_iterator.h:173:7: 错误:expected unqualified-id before ‘{’ token
{ return _M_at_eof() == __b._M_at_eof(); }

streambuf_iterator.h文件相关内容为:
bool
equal(const istreambuf_iterator& __b) const
{ return _M_at_eof() == __b._M_at_eof(); }

private:
int_type
_M_get() const
{
const int_type __eof = traits_type::eof();
int_type __ret = __eof;
if (_M_sbuf)
{
if (!traits_type::eq_int_type(_M_c, __eof))
__ret = _M_c;
else if (!traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
__eof))
_M_c = __ret;
else
_M_sbuf = 0;
}
return __ret;
}

bool
_M_at_eof() const
{
const int_type __eof = traits_type::eof();
return traits_type::eq_int_type(_M_get(), __eof);
}
};

template<typename _CharT, typename _Traits>
inline bool
operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return __a.equal(__b); }

template<typename _CharT, typename _Traits>
inline bool
operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return !__a.equal(__b); }

constants.h:266:22: 错误:expected unqualified-id before ‘(’ token
#define min(x,y) ( ((x) < (y)) ? (x) : (y) )

constants.h文件相关内容为:

#ifndef MACROS
#define MACROS

#define equal(a,b,n) ( strncmp(a,b,(size_t)(n)) == (int)0 )

#define max(x,y) ( ((x) > (y)) ? (x) : (y) )
#define min(x,y) ( ((x) < (y)) ? (x) : (y) )
#define clamp(x,lowerbound) ( ((x) < (lowerbound)) ? (lowerbound) : (x) )

怎么解决,各位牛人,谢谢?
...全文
314 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
z253642075 2014-12-04
  • 打赏
  • 举报
回复
这是autodock程序的一个源代码文件constants.h,请问怎么改?
勤奋的小游侠 2014-12-04
  • 打赏
  • 举报
回复
#define equal(a,b,n) ( strncmp(a,b,(size_t)(n)) == (int)0 ) 这个宏是谁定义的? 宏名字和系统库函数同名字了 把这个宏名字改一下

65,187

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧