问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/19718551/ada-compiler-gnat-on-mac-os