aseek-devel  

[aseek-devel] Problems with ccom.h

Jens Thoms Toerring
Tue, 23 Sep 2003 05:17:39 -0700

Hi,

  I am trying to compile the CVS version of aspseek on IRIX with
gcc 3.3.1 (when using the IRIX compiler the make process stops with
some linker problems that I wasn't able to figure out, and, no, I
can't use a different gcc version, sorry). My current problem is
with

    ~CPtr( ) 
    { 
       if ( p ) 
       { 
#ifdef _DEBUG 
           if ( ( * ( DWORD * ) p & 0x10000000 ) != 0x10000000 ) 
               OLEDB_Assert( "1", __FILE__, __LINE__ ); 
#endif 
           p->Release( );                           //  <- Line 79
       } 
    } 
 
    void Release( )
    { 
        IUnknown* pTemp = p; 
        if ( pTemp ) 
        { 
            p = NULL; 
            pTemp->Release( ); 
        } 
    } 

in class CPtr from ccom.h when compiling qparser.cpp. It compiles
without problems on Linux with gcc 3.2 but with 3.3.1 it complains,
error message is appended to the end of the mail.

I have a feeling that this might be related to the 'IUnknown' stuff
in "void Release()". I grepped through all the sources as well all
headers I could find on both machines but 'IUnknown' doesn't exist
anywhere. Interestingly, with gcc 3.2 one can replace 'IUnknown'
with whatever one wants (e.g. 'Blablabla') and it still compiles.
How it manages to figure out which Release() function is to be
used isn't clear to me. The only thing I could find out about
something called 'IUnknown' in C++ is some COM related stuff from
M$. So, is there any way to get around this problem?

                                  Regards, Jens
-- 
 Freie Universitaet Berlin     Jens Thoms Toerring
 Universitaetsbibliothek
 Webteam                       Tel: 0049 30 838 56055
 Garystrasse 39                Fax: 0049 30 838 53738
 14195 Berlin                  e-mail: [EMAIL PROTECTED]


In file included from qparser.cpp:24:
../include/ccom.h: In destructor `CPtr<T>::~CPtr() [with T = CSearchExpression]
   ':
/usr/local/include/c++/3.3.1/bits/stl_construct.h:125:   instantiated from
`void std::_Destroy(_Tp*) [with _Tp = std::pair<const CUWord,
CPtr<CSearchExpression> >]'
/usr/local/include/c++/3.3.1/ext/stl_hashtable.h:539:   instantiated from
`void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::_M_delete_node(__gnu_cxx::_Hashtable_node<_Val>*) [with _Val =
std::pair<const CUWord, CPtr<CSearchExpression> >, _Key = CUWord, _HashFcn =
__gnu_cxx::hash<CUWord>, _ExtractKey = std::_Select1st<std::pair<const CUWord,
CPtr<CSearchExpression> > >, _EqualKey = std::equal_to<CUWord>, _Alloc =
std::allocator<CPtr<CSearchExpression> >]'
/usr/local/include/c++/3.3.1/ext/stl_hashtable.h:950:   instantiated from
`void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::clear() [with _Val = std::pair<const CUWord, CPtr<CSearchExpression>
>, _Key = CUWord, _HashFcn = __gnu_cxx::hash<CUWord>, _ExtractKey =
std::_Select1st<std::pair<const CUWord, CPtr<CSearchExpression> > >, _EqualKey
= std::equal_to<CUWord>, _Alloc = std::allocator<CPtr<CSearchExpression> >]'
/usr/local/include/c++/3.3.1/ext/stl_hashtable.h:323:   instantiated from
`__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::~hashtable() [with _Val = std::pair<const CUWord,
CPtr<CSearchExpression> >, _Key = CUWord, _HashFcn = __gnu_cxx::hash<CUWord>,
_ExtractKey = std::_Select1st<std::pair<const CUWord, CPtr<CSearchExpression>
> >, _EqualKey = std::equal_to<CUWord>, _Alloc =
std::allocator<CPtr<CSearchExpression> >]'
../include/qparser.h:95:   instantiated from here
../include/ccom.h:79: error: `Release' undeclared (first use this function)
../include/ccom.h:79: error: (Each undeclared identifier is reported only once 
   for each function it appears in.)
../include/ccom.h: In destructor `CPtr<T>::~CPtr() [with T = CWord1]':
/usr/local/include/c++/3.3.1/bits/stl_construct.h:125:   instantiated from
`void std::_Destroy(_Tp*) [with _Tp = std::pair<const CUWord, CPtr<CWord1> >]'
/usr/local/include/c++/3.3.1/ext/stl_hashtable.h:539:   instantiated from
`void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::_M_delete_node(__gnu_cxx::_Hashtable_node<_Val>*) [with _Val =
std::pair<const CUWord, CPtr<CWord1> >, _Key = CUWord, _HashFcn =
__gnu_cxx::hash<CUWord>, _ExtractKey = std::_Select1st<std::pair<const CUWord,
CPtr<CWord1> > >, _EqualKey = std::equal_to<CUWord>, _Alloc =
std::allocator<CPtr<CWord1> >]'
/usr/local/include/c++/3.3.1/ext/stl_hashtable.h:950:   instantiated from
`void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::clear() [with _Val = std::pair<const CUWord, CPtr<CWord1> >, _Key =
CUWord, _HashFcn = __gnu_cxx::hash<CUWord>, _ExtractKey =
std::_Select1st<std::pair<const CUWord, CPtr<CWord1> > >, _EqualKey =
std::equal_to<CUWord>, _Alloc = std::allocator<CPtr<CWord1> >]'
/usr/local/include/c++/3.3.1/ext/stl_hashtable.h:323:   instantiated from
`__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::~hashtable() [with _Val = std::pair<const CUWord, CPtr<CWord1> >,
_Key = CUWord, _HashFcn = __gnu_cxx::hash<CUWord>, _ExtractKey =
std::_Select1st<std::pair<const CUWord, CPtr<CWord1> > >, _EqualKey =
std::equal_to<CUWord>, _Alloc = std::allocator<CPtr<CWord1> >]'
../include/qparser.h:95:   instantiated from here
../include/ccom.h:79: error: `Release' undeclared (first use this function)
*** Error code 1 (bu21)
*** Error code 1 (bu21)
*** Error code 1 (bu21)