From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6fa97b783a754ac4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-27 06:37:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNATLINKing objects that are not in the same directory Date: 27 Jul 2002 14:21:02 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: <5489a352.0207261254.b80d41e@posting.google.com> NNTP-Posting-Host: pogner.demon.co.uk X-NNTP-Posting-Host: pogner.demon.co.uk:62.49.19.209 X-Trace: news.demon.co.uk 1027777015 nnrp-13:24810 NO-IDENT pogner.demon.co.uk:62.49.19.209 X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:27433 Date: 2002-07-27T14:21:02+01:00 List-Id: 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