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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Can .ads be compiled alone? Date: Fri, 07 Nov 2014 12:14:33 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <520f8f3d-b345-4ef8-ac41-ead78edde92a@googlegroups.com> <92cf9a5a-52f7-4174-85b6-2629ba21d059@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1415380450 15395 192.74.137.71 (7 Nov 2014 17:14:10 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 7 Nov 2014 17:14:10 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:6u5kpAKLjFFJ3OiUEe8ls6PkCBA= Xref: number.nntp.giganews.com comp.lang.ada:190369 Date: 2014-11-07T12:14:33-05:00 List-Id: Adam Beneschan writes: > On Thursday, November 6, 2014 9:21:38 PM UTC-8, moixa wrote: >> Newbie question. >> >> I have only two files, machinery_1_3.ads [1] and machinery_1_3.adb >> [2], in some directory, when I `gnat compile machinery_1_3.ads`, it >> told me compile error, (but no further information). > > Did it actually say "compile error"? I get a very different message > when I try it, and that message *is* further information. > Specifically, I get this: > > cannot generate code for file machinery_1_3.ads (package spec) > to check package spec for errors, use -gnatc Recent versions of gnat leave out the second line above. It's kind of pointless -- either you saw some error messages (other than the "cannot generate code" one), or you didn't. Either way, there's no point in then typing: gcc -gnatc -c machinery_1_3.ads because you already have the information you were looking for. To the OP: You should use gnatmake or gprbuild to compile your programs. That way you don't have to worry about which files need to be compiled. - Bob