One of my students wanted to to compile Ada on Ubuntu for a project he is working with. He came to me for help. But Ada is like Chinese to me. How ever I managed to compile a simple hello world program. as below on Ubuntu 9.04
- Install GNAT (GNU New York University Ada Translator):
- Here is the hello.adb
- And use this command to compile:
sudo apt-get install gnat
with Ada.Text_IO; procedure Hello is begin Ada.Text_IO.Put_Line("Hello, world!"); end Hello;
gnat make hello.adbYou will get hello.ali and a binary hello in your home directory.
Alternately you can split the steps
- Run gcc to compile to object file:
- Run gnatbind to produce binder output:
- Run gnatlink to link and produce executable output:
gcc -c hello.adb
gnatbind hello.ali
gnatlink hello






















0 Comments
You can be the first one to leave a comment.