[omniORB] omniidl2 and crossed references ?

David Riddoch djr@uk.research.att.com
Wed, 24 Mar 1999 10:32:52 +0000 (GMT)


Fabien,

The reason this is a problem is that you have IDL statements above an
include directive.  Currently omniidl2 just doesn't cope with that.

I suggest the following instead:

------------------

#ifndef CHICKEN
#define CHICKEN

interface Egg;

interface Chicken {
  Egg lay() ;
};

#endif

------------------

#ifndef EGG
#define EGG

interface Chicken;

interface Egg {
  Chicken hatch() ;
};

#endif

------------------


Hope this helps,
David



On Fri, 19 Mar 1999, Fabien Azavant wrote:

> Hello,
> 
> I am quite new to omniORB, please excuse my question if it it silly.
> 
> I am trying to compile the following IDL interfaces :
> 
> File chicken.idl:
> ----------
> #ifndef CHICKEN
> #define CHICKEN
> interface Chicken ;
> #include "egg.idl"
> interface Chicken {
>   Egg lay() ;
> };
> #endif
> 
> 
> File egg.idl :
> --------
> #ifndef EGG
> #define EGG
> interface Egg ;
> #include "chicken.idl"
> interface Egg {
>   Chicken hatch() ;
> };
> #endif
> 
> 
> omniidl2 compiles the two files and generates
> the C++ files. However, the generated files cannot be compiled.
> I think the following lines should be added to
> chicken.hh :
> 
> class   Egg;
> typedef Egg* Egg_ptr;
> typedef Egg_ptr EggRef;
> class _proxy_Egg;
> class _sk_Egg;
> class _nil_Egg;
> 
> and similar lines should be added at the beginning of
> egg.hh
> 
> With these patches, everything works well.
> 
> Is it normal ?
> Did I forget a switch when running omniidl2 ?
> 
> By the way, I am running
> omniORB_2.7.0 under linux redhat5.1
> compiled with egcs.
> 
> Fabien
> 
> 
>