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,894ba04cfcf20b16 X-Google-Attributes: gid103376,public From: Andre Spiegel Subject: Re: Using Controlled type objects. Date: 1996/08/01 Message-ID: #1/1 X-Deja-AN: 171536599 sender: spiegel@berlin.berlin.informatik.uni-stuttgart.de references: <32008E75.6A3F@ncl.ac.uk> organization: University of Stuttgart, Germany newsgroups: comp.lang.ada Date: 1996-08-01T00:00:00+00:00 List-Id: Andrea Coccoli writes: > When I compile it, I receive this message: > genstack.ads:#: controlled type must be declared at the library level The problem is that you are trying to instantiate the generic inside your main procedure -- and hence, the controlled type is not at the library level. The error message is a bit misleading, because it is reported for the declaration within the generic package. But that one obviously *is* at the library level. [I think I've heard rumours that the GNAT team wants to enhance that error message, maybe they already did so, are you using the current version of GNAT?] Anyway, the solution is to instantiate the generic separately, like package My_Stack is new Reusable (...) as a compilation unit on its own, and then "with" that unit into your main procedure.