comp.lang.ada
 help / color / mirror / Atom feed
* circular unit dependency
@ 2005-01-04 18:31 R
  2005-01-04 23:45 ` Randy Brukardt
  2005-01-05  0:26 ` Stephen Leake
  0 siblings, 2 replies; 33+ messages in thread
From: R @ 2005-01-04 18:31 UTC (permalink / raw)


Hello everybody.

I've got a problem with circular unit dependency.

In main package I have:

with base;
with base.derv1;
with base.derv2;

derv1 has tagged record rec1 and derv2 has its rec2

the derv1 and derv2 packages have overritten operator "+"
which spec look like this:

in derv1 package spec and body I have:

with base.derv2; -- info about rec2 needed in "+" spec
...
function "+"(left: rec1; right: base.derv2.rec2) return rec1;

and the same thing with the second package spec and body:

with base.derv1; -- info about rec1 needed in "+"'s spec
...
function "+"(left: rec2; right: base.derv1.rec1) return rec2;

when I compile it with gcc i have:
main.adb:8:06: circular unit dependency
main.adb:8:06: "Main (body)" depends on "base.derv1 (spec)"
main.adb:8:06: "base.derv1 (spec)" depends on "base.derv2 (spec)"
main.adb:8:06: "base.derv2 (spec)" depends on "base.derv1 (spec)"
main.adb:8:06: "base.derv1 (spec)" depends on "base.derv1 (body)"
main.adb:8:06: "base.derv1 (body)" depends on "base.derv1 (spec)"
main.adb:8:06: "base.derv1 (spec)" depends on "base.derv1 (spec)"

well - I need info about other record because it's the parameter of
both function"+"

any idea? I tried to remove 'with' statement but then I received  msgs
like:
"xxx" not declared in "yyy"

thanks in advance

best regards
R




^ permalink raw reply	[flat|nested] 33+ messages in thread
* circular unit dependency
@ 2003-05-23  9:20 Mirko Aigner
  2003-05-23 11:37 ` Jeffrey Creem
  2003-05-23 18:08 ` Stephen Leake
  0 siblings, 2 replies; 33+ messages in thread
From: Mirko Aigner @ 2003-05-23  9:20 UTC (permalink / raw)


Hi Again !!

Any way to prevent this compiler error (circular unit dependency) 
without deleting one of the "with" statements ?!

Is there any way to make sure that on spec is only once "included" ?!

thanks for helping !!

greatings Mirko Aigner




^ permalink raw reply	[flat|nested] 33+ messages in thread
* circular unit dependency
@ 1998-05-26  0:00 Brendan Reville
  0 siblings, 0 replies; 33+ messages in thread
From: Brendan Reville @ 1998-05-26  0:00 UTC (permalink / raw)



I have two packages, each of which "with"s the other.

I get the following error:

   "Circular unit dependency."


How can I then allow each package to "with" the other?

Thanks very much for any help!

- Brendan




^ permalink raw reply	[flat|nested] 33+ messages in thread
* circular unit dependency
@ 1997-05-24  0:00 jdlopez
  1997-05-24  0:00 ` Michael F Brenner
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: jdlopez @ 1997-05-24  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]


     I am making a program with 2 classes that each one depends on the
other:

--class1.ads
with class2;
package class1 is
--...

--class2.ads
withc class1;
package class2 is
--...

     When I compile class1.ads or class2.ads with the freeware gnat
ADA 95 (301a) a error appears:

     circular unit dependency

     I see what is happening but:

1- �Is there any way of solving this?
2- �Could it be compiled with any compiler different from gnat?




^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2005-01-05  8:55 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04 18:31 circular unit dependency R
2005-01-04 23:45 ` Randy Brukardt
2005-01-05  8:35   ` Martin Krischik
2005-01-05  8:55     ` Duncan Sands
2005-01-05  0:26 ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2003-05-23  9:20 Mirko Aigner
2003-05-23 11:37 ` Jeffrey Creem
2003-05-23 12:12   ` David C. Hoos
2003-05-23 18:08 ` Stephen Leake
2003-05-24 22:12   ` Robert I. Eachus
2003-05-26  8:05   ` Mirko Aigner
1998-05-26  0:00 Brendan Reville
1997-05-24  0:00 jdlopez
1997-05-24  0:00 ` Michael F Brenner
1997-05-25  0:00 ` Jon S Anthony
1997-05-26  0:00   ` John G. Volan
1997-05-26  0:00     ` Fergus Henderson
1997-05-27  0:00     ` Jon S Anthony
1997-05-28  0:00 ` John G. Volan
1997-06-01  0:00   ` John G. Volan
1997-05-31  0:00 ` Kevin Cline
1997-05-31  0:00   ` John G. Volan
1997-06-01  0:00     ` Kevin Cline
1997-06-01  0:00       ` John G. Volan
1997-06-02  0:00     ` John G. Volan
1997-05-31  0:00   ` Matthew Heaney
     [not found]     ` <33932F31.4399@sprintmail.com>
1997-06-02  0:00       ` Matthew Heaney
1997-06-03  0:00         ` W. Wesley Groleau (Wes)
1997-06-03  0:00           ` John G. Volan
1997-06-03  0:00         ` John G. Volan
1997-06-05  0:00           ` Matthew Heaney
1997-06-05  0:00             ` John G. Volan
1997-06-06  0:00             ` Stephen Schmid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox