comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Help with some Code problems using C Interface
Date: 2000/04/16
Date: 2000-04-16T00:00:00+00:00	[thread overview]
Message-ID: <x7vem86t2di.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: 8d7l1n$q6n$1@nnrp1.deja.com

Ted Dennison <dennison@telepath.com> writes:

> In article <38F742E3.71D536BE@arlut.utexas.edu>,
>   Eric Bresie <bresie@arlut.utexas.edu> wrote:
> > Okay...I am working on some ADA with some C function bindings.
> >
> > I have the following error being displayed when I compile the given
> > code (spec and body) with the corresponding C code
> > <errors>
> > gnatbind -aO./ -aO. -I- -x tcim1.ali
> > gnatlink -g tcim1.ali
> > ./scsi_generic.o: In function `scsi_generic__inquiry':
> > ./scsi_generic.adb:53: undefined reference to `scsi_inquiry'
> 
> This is usually a result of either specifying a slightly incorrect name
> in the Ada interfacing pragma, or not linking against the object file
> that contains the C routine. Judging from the gnatbind command, I'd say
> its the latter. You need to reread the part of your compiler docs that
> covers interfacing to C.

And the gnatmake command you should use probably looks something like

  gnatmake tcim1 -largs scsi_inquiry.o

ie you need to tell gnatmake where to find this function you've
invented. I'm assuming the file name convention, of course, perhaps
it's in scim1.o :-)

You might just possibly find it useful to look at pragma Link_Options
-- however, in my experience that's only really helpful for little
programs, as soon as things start being spread over multiple
directories, or if you have multiple libraries with order dependence,
it all breaks down.




  reply	other threads:[~2000-04-16  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-14  0:00 Help with some Code problems using C Interface Eric Bresie
2000-04-14  0:00 ` Ted Dennison
2000-04-16  0:00   ` Simon Wright [this message]
2000-04-25  0:00 ` Erik Schalin
2000-04-25  0:00   ` David Starner
replies disabled

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