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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,489d583d6ad4bb9d,start X-Google-Attributes: gid103376,public From: dommo1234@my-deja.com Subject: LNK2005 error in ObjectAda compiler Date: 1999/06/23 Message-ID: <7kr499$cfi$1@nnrp1.deja.com>#1/1 X-Deja-AN: 492981641 X-Http-Proxy: 1.1 x21.deja.com:80 (Squid/1.1.22) for client 194.202.27.93 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Wed Jun 23 17:08:03 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Date: 1999-06-23T00:00:00+00:00 List-Id: All, I'm using ObjectAda V7.1.105 (special edition), and have come up against a rather strange error at build time. The error is :- error LNK2005: xxxxx.yyyyyy__acc_cleanup already defined in xxxxx.obj fatal error LNK1169: one or more multiply defined symbols found where xxxxx is the package name, and yyyyy is the type name. Test code that produces the problem is as follows :- ******************** File 'LinkTest.ads' ******************** with Ada.Finalization; use Ada.Finalization; package LinkTest is type baseType is new Controlled with -- See note 1. record recVar1: Boolean; index: Integer; end record; type baseType_A is access all baseType; type baseType_CWA is access all baseType'Class; -- See note 2. procedure Initialize(Obj: in out baseType); procedure Adjust(Obj: in out baseType); procedure Finalize(Obj: in out baseType); end LinkTest; ******************** File 'LinkTest.adb' ******************** package body LinkTest is procedure Initialize(Obj: in out baseType) is begin null; end Initialize; procedure Adjust(Obj: in out baseType) is begin null; end Adjust; procedure Finalize(Obj: in out baseType) is begin null; end Finalize; end LinkTest; ******************** File 'LinkTest.adb' ******************** with LinkTest; use LinkTest; procedure main is testVar: baseType; begin null; end main; ************************* End of test code ******************* The actual result of a build after a compile-all for the above project is as follows :- ********************* Compiler error output start ********************* --------------------Target: Win32 (Intel) Debug-------------------- ObjectAda Special Edition version 7.1.424: adabuild Copyright (c) 1997, Aonix. All Rights Reserved. obj\elt\main.obj linktest.obj : error LNK2005: linktest.basetype__acc_cleanup already defined in linktest.obj main.exe : fatal error LNK1169: one or more multiply defined symbols found Linking... Link of main failed rc=0. Tool execution failed. ********************* Compiler error output end ********************* Notes ----- (1) If we change this type specification so that the it doesn't inherit from Controlled, the link problems go away. (2) If 'baseType' does inherit from Controlled, but we remove this access type specification, the link problems go away. I've contacted Aonix, and someone did promise to look into it, but I've heared nothing since, and I really need a solution. Has anyone else seen this problem and found a solution?? Any help appreciated! Cheers, Dom. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.