[ROOT] RE:why this error is coming ???

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Thu Sep 06 2001 - 14:07:20 MEST


Hello Prasad,

There is not enough information, so I am not sure. But what I 
guess is you probably use pair or map container as follows.

  map<SomeType , const BioSequence&>
    or
  pair<SomeType, const BioSequence&>

What happens in stl_pair.h line 55 is 

bool operator==(const pair<T1,T2>& a, const pair<T1,T2>& b) {
  return ( a.first==b.first && b.second==b.second );
}

So, you need operator== for BioSequence class.  This code may
be compiled without Cint if you do not use operator==. But it
is a different story. Makecint instantiates every possible 
function in template library and triggers this kind of problem.

There can be 2 solutions.

 1. Define a dummy operator==, you already mention this.

 2. Use #pragma link off statement to mask those errors

I hope this information helps.

Thank you
Masaharu Goto


>Dear masa and rooters,
>
>       why this type of error is creeping..and how to avoid ???
>***************************************************************************
>/usr/include/g++-3/stl_pair.h: In function `bool operator== (const
>pair<_T1, _T2> &, const pair<_T1, _T2> &) [with _T1 = const int, _T2 =
>BioSequence]':
>G__cpp_BioBhasha.C:37:   instantiated from here
>/usr/include/g++-3/stl_pair.h:55: no match for `const BioSequence & ==
>const BioSequence &'
>/usr/include/g++-3/stl_tree.h:188: candidates are: bool operator==
>(const _Rb_tree_base_iterator &, const _Rb_tree_base_iterator &)
>/usr/include/g++-3/stl_pair.h: In function `bool operator< (const
>pair<_T1, _T2> &, const pair<_T1, _T2> &) [with _T1 = const int, _T2 =
>BioSequence]':
>/usr/include/g++-3/stl_algobase.h:412:   instantiated from
>`lexicographical_compare (_InputIter1, _InputIter1, _InputIter2, _InputIter2)
>[with _InputIter1 = _Rb_tree_iterator<pair<const int, BioSequence>, const
>pair<const int, BioSequence> &, const pair<const int, BioSequence> *>,
>_InputIter2 = _Rb_tree_iterator<pair<const int, BioSequence>, const pair<cons
t
>int, BioSequence> &, const pair<const int, BioSequence> *>]'
>/usr/include/g++-3/stl_tree.h:776:   instantiated from `operator< (const
>_Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> &, const _Rb_tree<_Key,
>_Value, _KeyOfValue, _Compare, _Alloc> &) [with _Key = int, _Value = 
pair<const
>int, BioSequence>, _KeyOfValue = _Select1st<pair<const int, BioSequence> >,
>_Compare = less<int>, _Alloc = __malloc_alloc_template<0>]'
>G__cpp_BioBhasha.C:217:   instantiated from here
>/usr/include/g++-3/stl_pair.h:62: no match for `const BioSequence & <
>const BioSequence &'
>make: *** [G__cpp_BioBhasha.o] Error 1
>*****************************************************************************
*
*
>
>
>thankyou for the help!.
>
>Do I have to do some dummy operator overloading for ==, <, >, * in my
>BioSequence Class ???
>
>
>sincerely,
>Prasad.
>
>-- 
>Be Happy,
>Enjoy Life.
>with love
>shiva.
>********************************************************************
>*   If the Problem is Clear, the Solution is  Near.    ...shiva... *
>********************************************************************
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET