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.
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