From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,18f6de557e6897b2 X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: circular unit dependency Date: 1997/05/24 Message-ID: <5m7ki5$f97@top.mitre.org>#1/1 X-Deja-AN: 243672538 References: <3386d96f.171920@noticias.ibernet.es> Organization: The MITRE Corporation, Bedford Mass. Newsgroups: comp.lang.ada Date: 1997-05-24T00:00:00+00:00 List-Id: jdlopez@caminos.recol.es asks about 2 classes that each depend on the other with class2; package class1 is ... withc class1; package class2 is ... This gives gnat ADA 95 (301a) error: circular unit dependency 1- ?Is there any way of solving this? Sometimes, there is. Perhaps the WITH statements could be moved to the body of packages class1 and class2. If both visible parts REALLY need to import each other then perhaps the part that is common could be put into a common CLASS3, and each of the existing classes could import the common class. If this is REAALLY impossible, then your circle appears not to be able to be broken. Sorry, if this is true. 2- ?Could it be compiled with any compiler different from gnat? No other compiler will let you do those 4 lines. You must approach the problem in a slightly different way without a circular dependency in the visible parts (the package specifications). However, circular dependencies ARE permitted in the package BODIES. This is good, and making you break the circle will lead you down the quickest path to making your code work. Not sorry about this one.