在VS2008下面编译通过的一套源码 在VC6下编译不过,报错如下:
error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'const class Oid' (or there is no acceptable conversion)
其中出错地方如下,这是头文件中一段:
 DLLOPT friend int operator==(const Oid &lhs, const Oid &rhs);
 DLLOPT friend int operator!=(const Oid &lhs, const Oid &rhs)
      { return (!(lhs == rhs)); };  
  DLLOPT friend int operator<(const Oid &lhs, const Oid &rhs);
  DLLOPT friend int operator<=(const Oid &lhs, const Oid &rhs)
      { return ((lhs < rhs) || (lhs == rhs)); };
  DLLOPT friend int operator>(const Oid &lhs, const Oid &rhs)
      { return (!(lhs <= rhs)); };  // just invert existing <=
  DLLOPT friend int operator>=(const Oid &lhs, const Oid &rhs)
      { return (!(lhs < rhs)); };  // just invert existing <
  DLLOPT friend int operator==(const Oid &lhs, const char *rhs);
  DLLOPT friend int operator!=(const Oid &lhs, const char *rhs);
  DLLOPT friend int operator<(const Oid &lhs, const char *rhs);
。比如我在第一个声明了“==”的重载  第一个声明“!=”时候调用了“==”的重载。按照我的理解我在调用前声明了,而且cpp中有实现,为什么还会报错,怎么样解决呢?