comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: GNATLINKing objects that are not in the same directory
Date: 27 Jul 2002 14:21:02 +0100
Date: 2002-07-27T14:21:02+01:00	[thread overview]
Message-ID: <x7v8z3xl329.fsf@pushface.org> (raw)
In-Reply-To: 5489a352.0207261254.b80d41e@posting.google.com

kcarron@belcan.com (Karen Carron) writes:

> I have not been able to get GNATLINK to work when the object files are
> not in the same directory as the one I'm doing gnatlink from.
> 
> Here is an example of the command I'm using:
> 
> gnatlink -aO/home/xxx/dev/test ro.ali tmain.o -lF77 -lsunmath
> 
> tmain.o, which contains the main program whose source is written in
> FORTRAN, is the file that is in another directory.  I'm not sure if it
> makes a difference that it is the main program?  Anyway, I've tried
> the -L, -l, and -I options also, at various places on the command line
> (before ro.ali, btw. ro.ali and tmain.o, btw. tmain.o and -lF77, and
> at the end).  I've also tried putting the path into a file and using
> that with the 4 switches (-aO, -L, -l, -I) at all those places on the
> command line.  I've also tried eliminating that switch, and setting
> the environment variable ADA_OBJECTS_PATH to the search path.  None of
> these things have worked.  I get the following error in all cases:
> 
> gcc: tmain.o: No such file or directory.

I suspect that when -aO says "When searching for library and object
files, look in directory dir" it's talking about what gnatmake does
(the flag is documented under gnatmake, not gnatlink -- 3.14a1) when
working out the closure.

tmain.o is not an Ada object, so it's of no interest to gnatlink
(which is concerned about elaboration). Of course, you have to have it
for ld when gnatlink calls it, cos it has your main() in it ..

You are expecting your executable to be named ro, right? so what is
wrong with

  gnatlink -aO/home/xxx/dev/test ro.ali /some/directory/tmain.o -lF77 -lsunmath

-S



      reply	other threads:[~2002-07-27 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-26 20:54 GNATLINKing objects that are not in the same directory Karen Carron
2002-07-27 13:21 ` Simon Wright [this message]
replies disabled

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