学习简单的Ada,在OS X中出现GNAT编译错误 [英] Learning simple Ada, getting GNAT compiling error in OS X

查看:92
本文介绍了学习简单的Ada,在OS X中出现GNAT编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全力以赴!



很高兴在这里找到我的方式,希望能在新的特许经营领域获得一些指导。我想学习Ada,所以我已经安装了EMACS和GNAT。我使用的是Mac,因此全部用于OS X。



问题是,即使我编写了最简单的Ada程序并保存了它们,在gcc之后我也会遇到gnatmake编译错误-c在bash中。这是教科书中的示例,因此我的代码没有错,让我相信它是我设置GNAT的方式。



更新:这就是bash的字面意思。 gcc -c test.adb之后立即显示 gnatmake: test.adb编译错误。如果我输入gcc -c test.adb而不是gnatmake test,则会收到错误:'-x ada'中的无效值'ada'。



我读了一个响应我需要将GNAT配置为我的PATH(在Mac OS上为



,然后双击GNAT图标(实际上是用于证券化)出于您的原因,您可能需要右键点击图标&选择打开),您将获得以下信息:





然后您进入一个非常标准的安装对话框。有时它会询问您要在哪里安装软件:我无法说出计算机上的默认设置(我想这是我的先前选择),但是我希望像这样的东西/ usr / local / GNAT / 2018 ;或 / Users / gustav / opt / GNAT / 2018 。不管怎样,都叫前缀



所有可执行文件都将放在 bin 子目录,因此您需要在 PATH < prefix> / bin c>。我非常希望安装过程中包含一些有关如何执行此操作的建议;或者您可以在此处


Sup all!

Glad to have found my way here hoping to receive some guidance in new chartered territory. I wanna learn Ada so I've installed EMACS and GNAT. I use a mac so it's all for OS X.

The problem is once I've written even the simplest of Ada procedures and saved them I get gnatmake compiling errors after gcc -c in bash. It's textbook examples so theres nothing wrong with my code making me believe its the way Ive set up GNAT.

UPDATE: Here's what it says in bash literally. "gnatmake: "test.adb" compilation error" straight after gcc -c test.adb. If I type gcc -c test.adb instead of gnatmake test I get "error: invalid value 'ada' in '-x ada'.

I read in one response I need to configure GNAT to my PATH (Ada compiler GNAT on Mac OS), what does that mean? Honestly I dont even know where GNAT goes after Ive "installed" it. Im so used to windows and here is an app in OSX that just installs without an EXE.

Please help me out!

解决方案

I’d forgotten that AdaCore have changed their Mac distribution method for GNAT CE 2018 to something more Mac-like.

When you double-click on the .dmg file you get this:

and when you double-click on the GNAT icon (actually, for security reasons, you’ll probably need to right-button on the icon & select 'Open') you get this:

and then you’re in a pretty standard installation dialog. At one point it asks where you want to install the software: I can’t say what the default will be on your machine (I think it’s remembering previous choices of mine), but I’d expect something like /usr/local/GNAT/2018; or maybe /Users/gustav/opt/GNAT/2018. Whatever, call that prefix.

All the executables will be in the bin subdirectory, so you’ll need to include <prefix>/bin at the start of your PATH. I’d very much expect the installation process to include some suggestions as to how to do this; or you could look here.

这篇关于学习简单的Ada,在OS X中出现GNAT编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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