0

I have two *.IDL files, where I have to deal with cyclic dependency:

#ifndef __USER_IDL__
#define __USER_IDL__

#include "Group.idl"

interface User
{
    typedef<sequence> Groups;
        Groups getGroups(); 
    void setGroups(in Groups u);
};

#endif

#ifndef __GROUP_IDL__
#define __GROUP_IDL__

#include "User.idl"

interface Group
{
    typedef<sequence> Users;
        Users getUser();    
    void setUsers(in Users u);
};

#endif

I need to keep it in separate files, how to solve it?

Check out my files: http://www32.zippyshare.com/v/32255598/file.html (I added there a Makefile, so simply run command: "make all") - the errors I get are:

omniidl -bcxx User.idl Group.idl:8: Syntax error in interface body Group.idl:8: Error in look-up of 'Users': 'Users' not found Group.idl:9: Error in look-up of 'Users': 'Users' not found Group.idl:10: Error in look-up of 'Users': 'Users' not found User.idl:8: Syntax error in interface body User.idl:8: Error in look-up of 'Groups': 'Groups' not found User.idl:9: Error in look-up of 'Groups': 'Groups' not found User.idl:10: Error in look-up of 'Groups': 'Groups' not found omniidl: 8 errors.

mazix
  • 2,540
  • 8
  • 39
  • 56

1 Answers1

2

You can forward declare an interface, for example use

interface Group;

And than zap the include of Group.idl in the Users idl file

Johnny Willemsen
  • 2,942
  • 1
  • 14
  • 16
  • Yeah, its have a chance to work, please, take a look: http://pastie.org/private/tx8h0wmb2klxb18brlddg but I concern about warnings I get: http://pastie.org/private/vjex0kkhm8rlkr0wr5rqdg is it sth serious or I don't have to care much about it? Please, tell me if you can – mazix Aug 05 '12 at 12:02