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

* Re: LNK2005 error in ObjectAda compiler
  1999-06-23  0:00 LNK2005 error in ObjectAda compiler dommo1234
@ 1999-06-23  0:00 ` Vladimir Olensky
  1999-06-24  0:00   ` dommo1234
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Olensky @ 1999-06-23  0:00 UTC (permalink / raw)


This is the exactly the same bug that I described here on 21.06.99 providing
piece of assembler code.
Look at my post "OA bug ?" and  Tucker Taft  response to it with all info
about that bug.


Regards,
Vladimir Olensky



dommo1234@my-deja.com wrote in message <7kr499$cfi$1@nnrp1.deja.com>...
>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
>
>






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

* Re: LNK2005 error in ObjectAda compiler
  1999-06-23  0:00 ` Vladimir Olensky
@ 1999-06-24  0:00   ` dommo1234
  1999-06-24  0:00     ` Tucker Taft
  0 siblings, 1 reply; 4+ messages in thread
From: dommo1234 @ 1999-06-24  0:00 UTC (permalink / raw)


In article <930161697.632.27@news.remarQ.com>,
  "Vladimir Olensky" <vladimir_olensky@yahoo.com> wrote:
> This is the exactly the same bug that I described here on 21.06.99
providing
> piece of assembler code.
> Look at my post "OA bug ?" and  Tucker Taft  response to it with all
info
> about that bug.
>
> Regards,
> Vladimir Olensky
>
> dommo1234@my-deja.com wrote in message <7kr499
$cfi$1@nnrp1.deja.com>...
> >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
> >
> >
>
>
Hmmm, in his response to the post "OA bug ?", Tucker says that the
problem only occurs when the Controlled type is not fully defined
before the two access types. This is not the case in my example
however, so I wonder if this is not the same bug.

If anyone gets any support from Aonix on this link bug, I'd be grateful
if they'd post the relevant info here or mail me at dommo@imsltd.com !
Until then I guess I'll have to either use GNAT with it's not-very-
friendly interface, or buy a pucker copy of OA...

Rgds,
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

* Re: LNK2005 error in ObjectAda compiler
  1999-06-24  0:00   ` dommo1234
@ 1999-06-24  0:00     ` Tucker Taft
  0 siblings, 0 replies; 4+ messages in thread
From: Tucker Taft @ 1999-06-24  0:00 UTC (permalink / raw)


dommo1234@my-deja.com wrote:
> 
> In article <930161697.632.27@news.remarQ.com>,
>   "Vladimir Olensky" <vladimir_olensky@yahoo.com> wrote:
> > This is the exactly the same bug that I described here on 21.06.99
> providing
> > piece of assembler code.
> > Look at my post "OA bug ?" and  Tucker Taft  response to it with all
> info
> > about that bug.
> >
> > Regards,
> > Vladimir Olensky
> >
> > dommo1234@my-deja.com wrote in message <7kr499
> $cfi$1@nnrp1.deja.com>...
> > >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
> > >
> > >
> >
> >
> Hmmm, in his response to the post "OA bug ?", Tucker says that the
> problem only occurs when the Controlled type is not fully defined
> before the two access types. This is not the case in my example
> however, so I wonder if this is not the same bug.

It is the same bug.

I probably should have made mention of "freezing point" rather
than "fully defined."  A tagged type is not considered "fully defined"
in this context until overridings of its primitive subprograms have
occurred.  Hence, if you move the declarations of Initialize,
Adjust, and Finalize up in front of the access type declarations,
it should not end up with multiple definitions.

> ...
> Rgds,
> Dom.


-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




^ 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