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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6c7dea22b75ba442 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!news.he.net!xara.net!gxn.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ada compiler? Date: Tue, 13 Nov 2007 22:27:01 +0000 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1194992820 21065 62.49.19.209 (13 Nov 2007 22:27:00 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 13 Nov 2007 22:27:00 +0000 (UTC) Cancel-Lock: sha1:h+SI9cK1zy1IJJuMeeYjOH3Eenc= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news1.google.com comp.lang.ada:18350 Date: 2007-11-13T22:27:01+00:00 List-Id: writes: > "Bill Cunningham" wrote in message > news:A75Zi.24$Vp3.16@trnddc05... >> I have just began looking at the ada language and some tutorials >> but I have no idea how to compile ada programs. I am using gcc with >> C,C++, and Ada support. Do Ada programs have to end in .ads ? How >> do I work the compiler? >> > Ada programs are not required to end in .adb or .ads. This is a > convention adopted by GNAT. Seom compilers allow files to end in > any extension you want to choose. Also, GNAT requires that the > internal name match the file name. This is also a convention unique > to GNAT. Other compilers allow a mismatch between the internal name > and the external name. GNAT doesn't normally mind too much if the main program has the wrong name; I just saved the normal Hello program as hi.ada and gnatmake said grendel:~/tmp simon$ gnatmake hi.ada gcc -c -x ada hi.ada hi.ada:2:11: warning: file name does not match unit name, should be "hello.adb" gnatbind -x hi.ali gnatlink hi.ali grendel:~/tmp simon$ ./hi hello. You do have to jump through hoops if you want this to work with with'ed units, though. --S