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=0.5 required=5.0 tests=BAYES_40,FREEMAIL_FROM, HELO_NO_DOMAIN,MAILING_LIST_MULTI,RDNS_NONE,SPOOFED_FREEMAIL_NO_RDNS, URI_TRY_3LD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,547e6c7b9fae4e1d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-22 02:24:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!not-for-mail From: "Gautier direct_replies_not_read" Newsgroups: comp.lang.ada Subject: Instanciation in a package spec. Date: Wed, 22 Jan 2003 10:22:23 +0000 Organization: ENST, France Message-ID: Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: avanie.enst.fr 1043231050 6842 137.194.161.2 (22 Jan 2003 10:24:09 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 22 Jan 2003 10:24:09 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Originating-IP: [213.173.163.2] X-OriginalArrivalTime: 22 Jan 2003 10:22:23.0988 (UTC) FILETIME=[27985B40:01C2C200] X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:33339 Date: 2003-01-22T10:22:23+00:00 In a package specification, I have: generic what: String; package Ad_hoc is function Last return String; procedure Add; procedure Put_Last; end Ad_hoc; package Ad_hoc_type is new Ad_hoc("type"); * ObjectAda 7.2.1 compiles it fine. But link fails: pascalhe.obj : error LNK2001: unresolved external symbol pascalhelp.default_instanciations__elab_bool haddock.obj : error LNK2001: unresolved external symbol pascalhelp.ad_hoc_type.add haddock.obj : error LNK2001: unresolved external symbol pascalhelp.ad_hoc_type.put_last haddock.exe : fatal error LNK1120: 3 unresolved externals * GNAT 3.15p issues: pascalhe.ads:135:03: warning: cannot instantiate "Ad_hoc" before body seen pascalhe.ads:135:03: warning: Program_Error will be raised at run time Who is right ? Of course I would like to keep is as I've programmed, although there is surely a workaround by making a new package with the instanciations. I'd prefer to avoid it. ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site! _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail