comp.lang.ada
 help / color / mirror / Atom feed
From: Szymon Guz <guzo@stud.ics.p.lodz.pl>
Subject: import errors
Date: Sun, 07 Mar 2004 19:55:57 +0100
Date: 2004-03-07T19:55:57+01:00	[thread overview]
Message-ID: <c2frbi$ac$1@nemesis.news.tpi.pl> (raw)

Hi,
I'm trying to make a binding to a dll library written in C++ and I'va 
got a problem. I have two types in one package and two procedures that 
are named the same:

type A;
type B is new A;

procedure A(this:A_Access);
procedure A(this:B_Access);

and now I want to import them from the dll library, but writing sth like 
  this:

pragma Import(C,A,"AAA");
pragma Import(C,A,"BBB");

generates some compiler errors, so I tried to do it in this way:
the body of the procedures looks like this:

procedure A(this:A_Access) is
   procedure THIS_A(this:A_Access);
   pragma Import(C,THIS_A,"AAA");
begin
   THIS_A(this);
end;

procedure A(this:B_Access) is
   procedure THIS_A(this:B_Access);
   pragma Import(C,THIS_A,"BBB");
begin
   THIS_A(this);
end;

I thought that it should work fine, but now I see that there is a 
compiler error which I don't undestand:

undefined reference to 'AAA'

So i've got two questions:
what do I do wrong that I cannot import the functions in the *.adb file 
and I can in the *.ads file ?
how can I import the functions ?



             reply	other threads:[~2004-03-07 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-07 18:55 Szymon Guz [this message]
2004-03-07 19:10 ` import errors Jeff C,
2004-03-07 20:07   ` Szymon Guz
2004-03-10  2:18 ` Stephen Leake
replies disabled

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