Ada compiler GNAT on Mac OS

血红的双手。 提交于 2020-01-03 17:01:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!