comp.lang.ada
 help / color / mirror / Atom feed
* Gnat binding specific question
@ 1999-04-06  0:00 Boulais, Jeffrey M
  1999-04-06  0:00 ` Steve Quinlan
  0 siblings, 1 reply; 2+ messages in thread
From: Boulais, Jeffrey M @ 1999-04-06  0:00 UTC (permalink / raw)


This is a Gnat specific question, so I'm sorry.

I'm getting a circular withing error during binding (Windows NT, Gnat3.11),
here's the error:
   error: elaboration circularity detected
   info:    "dgs (body)" must be elaborated before "dgs (body)"
   info:       reason: Elaborate_All probably needed in unit "dgs (body)"
   info:       recompile "dgs (body)" with -gnatwl for full details
   info:          "dgs (body)"
   info:             is needed by its spec:
   info:          "dgs (spec)"
   info:             which is withed by:
   info:          "mfd_pkg (spec)"
   info:             which is withed by:
   info:          "symbols (body)"
   info:             which is needed by its spec:
   info:          "symbols (spec)"
   info:             which is withed by:
   info:          "dgs (body)"
   gnatmake: *** bind failed.

Now, I checked the documentation (gnat_ug), and it had a section very
specific to this (What to do if the default
elaboration behavior fails).  However, I tried a couple of their fixed to no
avail. I originally had:

   with Symbols ;
   pragma Elaborate (Symbols) ;

in DGS.ADB.  I changed this to "pragma Elaborate_All (Symbols) ;", but it
didn't work.  I also tried passing in the
"-bargs -f" during gnatmake, and that didn't work either, nor did -gnatE
have any effect.  I haven't yet tried
re-arranging the code to remove this "Circular withing" (I personally don't
think it truely is), because it will be time
consuming.  If anyone has any suggestions, I'd appreciate it.  Thanks...



   -**** Posted from RemarQ, http://www.remarq.com/?a ****-
 Search and Read Usenet Discussions in your Browser - FREE -




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

* Re: Gnat binding specific question
  1999-04-06  0:00 Gnat binding specific question Boulais, Jeffrey M
@ 1999-04-06  0:00 ` Steve Quinlan
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Quinlan @ 1999-04-06  0:00 UTC (permalink / raw)


Boulais, Jeffrey M wrote:

> This is a Gnat specific question, so I'm sorry.
>
> I'm getting a circular withing error during binding (Windows NT, Gnat3.11),
> here's the error:

It's impossible to completely diagnose without knowing what elaboration pragmas
you had in each unit, and what declarations you use from each unit in
elaboration code. It is possible to have legal withing, but generate elaboration
errors by having incorrect elaboration pragmas.

Try taking out the 'pragma elaborate (symbols)' from dgs.adb. If mfd_pkg.ads has
a pragma elaborate for dgs, then you don't need and in fact cannot have this
pragma in dgs. It's the same situation as if you had two packages, a and b,
whose bodies with'ed each other's specs. You cannot have a pragma elaborate for
BOTH withs, only one of them, because in that case the pragmas themselves are
trying to force circular elaboration.

Also, you may need to compile with the -gnatE switch unless you are going to
follow GNAT's recommended elaboration pragma strategy; which, it does not look
like you did, since you said you originally had a 'pragma elaborate' -- they
don't recommend those.






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

end of thread, other threads:[~1999-04-06  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-06  0:00 Gnat binding specific question Boulais, Jeffrey M
1999-04-06  0:00 ` Steve Quinlan

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