comp.lang.ada
 help / color / mirror / Atom feed
From: "Scott Travak" <s.travak@j-inet.com>
Subject: elaboration circularity detected problem, How to fix?
Date: Tue, 21 Sep 2004 00:51:36 +1000
Date: 2004-09-21T00:51:36+10:00	[thread overview]
Message-ID: <414eee7d@dnews.tpgi.com.au> (raw)

Hi everyone, I was hoping to obtain some assistance with a program I am 
constructing. Essentially my program is made up as follows:

1) Two packages (one of which is a generic package).
2) Each package essentially contains a task
3) Each task contains a reference to (operates on) the other task

I am encountering a "elaboration circularity detected" error (see below).

-----------------
Error received:
-----------------

error: elaboration circularity detected
info:    "main (body)" must be elaborated before "main (body)"
info:       reason: Elaborate_All probably needed in unit "main (body)"
info:       recompile "main (body)" with -gnatwl for full details
info:          "main (body)"
info:             must be elaborated along with its spec:
info:          "main (spec)"
info:             which is withed by:
info:          "location (body)"
info:             which must be elaborated along with its spec:
info:          "location (spec)"
info:             which is withed by:
info:          "main (body)"

gnatmake: *** bind failed.

I do not know how to get myself out of this one. I think it has something to 
do with the way I have placed the instantiated package within the context of 
the code. There are two places where I have defined the same instantiated 
package. I think I should only define it once. But I don't know how to get 
around the dependency loop.

Any help would be greatly appreciated!

Thanks
Scott.


-----------
entry.adb
-----------

with Location;

procedure entry is

  package Chicago_Ptr is new Location (Chicago);

begin

  Chicago_Ptr.TaskA_Ptr := new Chicago_Ptr.TaskA_Type;

end;

------------
location.ads
------------

generic
  ..

package Location is

  task type taskA_Type is
  begin
  ..
  end taskA_Type;

  type taskA_Ptr_Type is access taskA_Type;
  taskA_Ptr : taskA_Ptr_Type;

end Location;

------------
location.adb
------------

with Main;
use  Main;

package body Location

  task body taskA_Type is
  begin
  ..
  taskB.Some_ChannelB();
  end taskA_Type;

end Location;

-----------------
main.ads
-----------------

package Main is

  task taskB is
  begin
  ..
  end taskB;

end Main;

-----------------
main.adb
-----------------

with Location

package body Main is

  package Chicago_Ptr is new Location (Chicago);

  task body taskB is
  begin
  ..
  Chicago_ptr.Some_ChannelA();
  end taskB;

end Main;






             reply	other threads:[~2004-09-20 14:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 14:51 Scott Travak [this message]
2004-09-20 15:52 ` elaboration circularity detected problem, How to fix? Martin Dowie
2004-09-20 17:11   ` Florian Weimer
2004-09-20 21:19     ` Randy Brukardt
2004-09-21 10:09       ` Martin Dowie
2004-09-21 17:53         ` Randy Brukardt
2004-09-21  6:32   ` Scott Travak
2004-09-21  7:30     ` gnat options (Re: " Peter Hermann
2004-09-21  8:00       ` Scott Travak
2004-09-21  8:09       ` Alex R. Mosteo
     [not found] ` <7e7vk0dv2qhpqbdd58c0bvpesitapijr8v@4ax.com>
2004-09-21  6:44   ` Scott Travak
2004-09-21 18:40     ` Ludovic Brenta
2004-09-21 20:15       ` Scott Travak
2004-09-22 21:08 ` Simon Wright
replies disabled

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