5

I'm trying to compile ada using the terminal on my mac but I always get this error "error: invalid value 'ada' in '-x ada' " anyone knows how can I fix this?

Nor
  • 51
  • 1
  • 2
  • Welcome to Stack Overflow! When asking a question, please show us what you're doing (in this case, which command you're executing on the command line). – flyx Nov 01 '13 at 13:59
  • See [this answer](http://stackoverflow.com/a/14568416/40851). Which version of Mac OS X are you using? (because that answer needs updating for Mavericks). – Simon Wright Nov 01 '13 at 23:19

1 Answers1

6

You probably don't have an Ada compiler installed, the gcc that comes with OSX does not support Ada. Currently, there are two flavors of free Ada-enabled gcc binaries for OSX:

  • GNAT GPL from AdaCore (select x86_64-darwin as platform). This compiler and the accompanying runtime library are licensed under the GPL, meaning that if you compile applications with it, you have to license them under the GPL if you want to spread it.
  • FSF GCC, compiled from the GCC sources. It is licensed under the GPL with runtime library exception, meaning that you don't have to license software you compile with it under the GPL.

Once you installed one of these compilers and added it to your PATH, you can easily compile your Ada code with

gnatmake your_ada_file.adb
Simon Wright
  • 25,108
  • 2
  • 35
  • 62
flyx
  • 35,506
  • 7
  • 89
  • 126