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