Mac OS上的Ada编译器GNAT [英] Ada compiler GNAT on Mac OS

查看:190
本文介绍了Mac OS上的Ada编译器GNAT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac上使用终端来编译ada,但我总是收到此错误
错误:'-x ada'中的无效值'ada'任何人都知道如何解决此问题?

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?

推荐答案

您可能没有安装Ada编译器,OSX随附的gcc不支持Ada。目前,有两种免费的OSX支持Ada的gcc二进制文件:

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 (选择 x86_64-darwin 作为平台)。该编译器和随附的运行时库是根据GPL许可的,这意味着如果您使用它编译应用程序,则要分发它,就必须根据GPL对其进行许可。

  • FSF GCC ,从GCC来源编译而来。它是根据GPL许可的,但运行时库例外,这意味着您不必根据GPL许可使用其编译的软件。

  • 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.

一旦您安装了其中一个编译器并将其添加到 PATH 中,您就可以轻松地使用

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

这篇关于Mac OS上的Ada编译器GNAT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆