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.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ebfd1d7c60facfc5,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Scott Travak" Newsgroups: comp.lang.ada Subject: elaboration circularity detected problem, How to fix? Date: Tue, 21 Sep 2004 00:51:36 +1000 Organization: - X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 220.244.246.157 X-Original-NNTP-Posting-Host: 220.244.246.157 Message-ID: <414eee7d@dnews.tpgi.com.au> X-Trace: dnews.tpgi.com.au!tpg.com.au 1095691901 220.244.246.157 (21 Sep 2004 00:51:41 +1000) Path: g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!nntp.gblx.net!nntp3.phx1!dnews.tpgi.com.au!tpg.com.au!not-for-mail Xref: g2news1.google.com comp.lang.ada:3864 Date: 2004-09-21T00:51:36+10:00 List-Id: 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;