[omniORB] Forward declarations and includes (IDL)

Carlos carlos@solaria-mediterranea.com
Fri, 21 Sep 2001 08:33:56 +0200


Matej Kenda wrote:
>=20
> Hi,
>=20
> I am resending this mail, because it has most probably been filtered ou=
t due
> to Nimda virus attack.
>=20
> I have multiple CORBA classes and each of them is in its own IDL file.
> Interfaces refer to each other directly or via sequences.
>=20
> The problem that I have is that omniidl compiler generates sources with=
out
> any problems, but the compiler complains with errors:
>=20
> g++ -Wall -D__linux__ -D__x86__ -D__OSVERSION__=3D2 -D_REENTRANT -I.
> -I../../../ivd-3rdparty/omni/include   -c -o i_class_a.o i_class_a.cpp
> In file included from i_class_a.h:26,
>                  from i_class_a.cpp:3:
> i_class_b.h:156: `i_ClassA_ptr' was not declared in this scope
> i_class_b.h:156: parse error before `)'
> i_class_b.h:157: syntax error before `*'
> i_class_b.h:189: `i_ClassA_ptr' was not declared in this scope
> i_class_b.h:189: parse error before `)'
> i_class_b.h:190: ISO C++ forbids declaration of `i_ClassAList_t' with n=
o
> type
> i_class_b.h:190: `i_ClassAList_t' declared as a `virtual' field
> i_class_b.h:190: parse error before `*'
>=20
> I use omniORB 3.0.4 with latest updates.
> g++ is version 2.96 (RedHat 7.1).
>=20
> I have attached sample code that reproduces this problem.
>=20
> Are the IDLs written wrongly or is there something else that is not OK =
in my
> case?
>=20
> Regards,
>=20
> Matej
>=20
> P.S.: IDL files are listed below this line.
>=20
> ***** i_base.idl:
>=20
> #ifndef _I_BASE_IDL_
> #define _I_BASE_IDL_
>=20
> interface i_Base {
>=20
>     void DoBasiecThings();
>=20
> };
>=20
> #endif // _I_BASE_IDL_
>=20
> ***** i_class_a.idl:
>=20
> #ifndef _I_CLASS_A_IDL_
> #define _I_CLASS_A_IDL_
>=20
> interface                   i_ClassA;
> typedef sequence<i_ClassA>  i_ClassAList_t;
>=20
> #include "i_base.idl"
> #include "i_class_b.idl"
>=20
> interface i_ClassA : i_Base {
>=20
>     void DoA();
>     void UseClass(in i_ClassB a_class);
> };
>=20
> #endif // _I_CLASS_A_IDL_
>=20
> ***** i_class_b.idl:
>=20
> #ifndef _I_CLASS_B_IDL_
> #define _I_CLASS_B_IDL_
>=20
> interface i_ClassB;
>=20
> #include "i_base.idl"
> #include "i_class_a.idl"
>=20
> interface i_ClassB : i_Base {
>=20
>     void UseClass(in i_ClassA a_class);
>     i_ClassAList_t GetList();
>=20
> };
>=20
> #endif // _I_CLASS_B_IDL_
>=20
>   ---------------------------------------------------------------------=
---
>                              Name: fordecl_include.tar.gz
>    fordecl_include.tar.gz    Type: Unix Tape Archive (application/x-tar=
)
>                          Encoding: base64

Hi all:

	We have a similar situation with about 50 interfaces, without
inheritance and the include statement before than forward declarations
and don't have problems.

	Can you tell us if the compilation problems are with the skeletons or
with the implementation?.

Carlos

Solaria Mediterr=E1nea, S.L.L.