1

I have installed GNAT 4.3 from here

And added the following to my .bash_profile:

export PATH=/usr/local/ada-4.3/bin:$PATH

Now I can run gnatmake hello.adb

For the file hello.adb with the following contents:

with Ada.Text_IO;use Ada.Text_IO;
procedure Hello is
begin
    Put_Line ("Hello world!");
end Hello;

But I get this error:

gcc -c hello.adb

gcc: error trying to exec 'as': execvp: No such file or directory

gnatmake: "hello.adb" compilation error

I'm guessing there is a problem with my GNAT installation, but I have been unable to find a solution for this problem.

Thanks in advance for any suggestions.

aizaz
  • 3,056
  • 9
  • 25
  • 57
KMA
  • 25
  • 5

1 Answers1

2

Your approach works on Mac OS X 10.5 and 10.6, but I haven't tried 10.8. Two things to check:

  • It looks like it can't find the assembler, /usr/bin/as. Verify that you installed the developer tools, as it's an optional install. See also How to use/install gcc on Mac OS X 10.8 / Xcode 4.4.

  • Use the verbose option of gcc to see more about where it's getting lost.

    gcc -c -v hello.adb
    
Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • @SimonWright: I defer to your 10.8 experience; please don't hesitate to correct or amplify. – trashgod Jan 12 '13 at 08:53
  • @trashgod: As your link suggested installing command line tools from Xcode (Xcode->Preferences->Downloads) fixed the issue. I can now build hello.adb. – KMA Jan 12 '13 at 18:41