comp.lang.ada
 help / color / mirror / Atom feed
* LNK2005 error in ObjectAda compiler
@ 1999-06-23  0:00 dommo1234
  1999-06-23  0:00 ` Vladimir Olensky
  0 siblings, 1 reply; 4+ messages in thread
From: dommo1234 @ 1999-06-23  0:00 UTC (permalink / raw)


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.




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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-23  0:00 LNK2005 error in ObjectAda compiler dommo1234
1999-06-23  0:00 ` Vladimir Olensky
1999-06-24  0:00   ` dommo1234
1999-06-24  0:00     ` Tucker Taft

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