[omniORB] IDL modules

Stefan Seefeld seefelds@MAGELLAN.UMontreal.CA
Tue, 24 Aug 1999 16:07:13 +0000


Peter Ledbrook wrote:
> 
> Hi,
> 
>  A simple question on the use of modules. Is this OK:
> 
> A.idl:
> 
>   module my_mod
>   {
>     interface A
>     {
>       ...
>     };
>   };
> 
> B.idl:
> 
>   #include "A.idl"
> 
>   module my_mod
>   {
>     interface B
>     {
>       ...
>     };
>   };
> 
> I ask because omniidl2 on NT4 (omniORB 2.7.1) thinks this is OK, but the
> same compiler on IRIX 6.5 says that it is a redefinition of 'my_mod' and
> is thus an error. Surely not everything in a module needs to be declared
> within the same set of braces? All I want is for A and B to be in the
> same module but not the same file.

Well, the IDL is fine. The question is what C++ code you get. If your
compiler
supports namespaces then the module should simply map to a namespace for
which
the same rules apply (you can reopen it and add new types as often as
you like).
However, it seems as if your compiler doesn't understand namespaces
because of
the error you mention (redefinition of my_mod). You need to make sure to
tell
omniidl2 that you can't handle namespaces. The C++ language binding has
a special
clause for this case.

Stefan
_______________________________________________________              
              
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: seefelds@magellan.umontreal.ca

_______________________________________________________

      ...ich hab' noch einen Koffer in Berlin...