[omniORB] Compiling omniORB 4.0.1 with Visual C++ .NET 2003 (7.1)

Matej Kenda matejkenda@volja.net
Mon Apr 28 16:32:01 2003


Hi,

I wanted to compile a project that uses omniORB 4.0.1 on Windows XP,
using new Visual C++ .NET 2003 copiler (version 7.1).

Source code was originally developed on Linux and it also compiled and
worked fine with VC++ 7.0.

However, VC++ 7.1 compiler reported errors for all direct calls of
::operator>>=(whatever) from inline operators:

        D:\\omniORB4\include\omniORB4\Naming.hh(1027) : error C2665: 'operator`>>='' : none of the 91 overloads can convert parameter 1 from type 'CORBA::Long'

For example:

        Naming.hh:1027
        
        inline void operator >>=(CosNaming::BindingType _e, cdrStream& s) {
          ::operator>>=((CORBA::Long)_e, s);
        }

Call to ::operator() should find:

        cdrStream.h:261
        
          friend inline void operator>>= (_CORBA_Long a, cdrStream& s) {
            if (s.pd_marshal_byte_swap) {
              _CORBA_Long t = Swap32(a);
              a = t;
            }
            CdrMarshal(s,_CORBA_Long,omni::ALIGN_4,a);
          }
        
I have tried many things. The solution that warked was to change the
implementation of the operator to:

        inline void operator >>=(CosNaming::BindingType _e, cdrStream& s) {
            (CORBA::Long)_e >>= s;
        }
        
And it worked.

As far as I have found out, the cdrStream's operators are on the global
scope and the original function call should succeed. But the compiler
didn't list the proper operator among those that it tried to use. See
the output below.

Is this a bug in the compiler?
Has anyone alse tried the 7.1 compiler with omniORB yet?

With best regards,

Matej

P.S.: Truncated error output of the compiler:

D:\\omniORB4\include\omniORB4\Naming.hh(1027) : error C2665: 'operator`>>='' : none of the 91 overloads can convert parameter 1 from type 'CORBA::Long'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): could be 'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::UNKNOWN *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::BAD_PARAM *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::NO_MEMORY *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::IMP_LIMIT *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::COMM_FAILURE *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::INV_OBJREF *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::NO_PERMISSION *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::INTERNAL *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::MARSHAL *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::INITIALIZE *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::NO_IMPLEMENT *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::BAD_TYPECODE *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::BAD_OPERATION *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::NO_RESOURCES *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::NO_RESPONSE *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::PERSIST_STORE *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::BAD_INV_ORDER *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::TRANSIENT *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::FREE_MEM *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::INV_IDENT *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::INV_FLAG *& )'
 D:\\omniORB4\include\omniORB4\corba_operators.h(41): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CORBA::INTF_REPOS *& )'
...
 D:\\omniORB4\include\omniORB4\Naming.hh(1015): or       'CORBA::Boolean operator >>=(const CORBA::Any &,CosNaming::NameComponent *& )'
 D:\\omniORB4\include\omniORB4\Naming.hh(1016): or       'CORBA::Boolean operator >>=(const CORBA::Any &,const CosNaming::NameComponent *& )'
 D:\\omniORB4\include\omniORB4\Naming.hh(1023): or       '_CORBA_Boolean operator >>=(const CORBA::Any &,CosNaming::Name *& )'
 D:\\omniORB4\include\omniORB4\Naming.hh(1024): or       '_CORBA_Boolean operator >>=(const CORBA::Any &,const CosNaming::Name *& )'
 D:\\omniORB4\include\omniORB4\Naming.hh(1026): or       'void operator >>=(CosNaming::BindingType,cdrStream &)'
 while trying to match the argument list '(CORBA::Long, cdrStream)'