AWS for Ada 的安装问题

发布于 2024-12-14 13:57:35 字数 775 浏览 2 评论 0 原文

今晚我第一次在 Macbook 上安装了 Ada 和 AWS。

安装似乎一切顺利,但我感觉 AWS 没有安装到正确的目录。

GNAT 位于 /usr/local/gnat 中。

AWS makefile.conf 说,

AWS will be installed under $(prefix). Update this variable to point to
the install directory. By default, it is set to the current GNAT root
directory to have AWS project files automatically available.

所以我没有更改目标。

但是,当我尝试从系统上除 AWS demos 文件夹之外的任何位置编译 hello_world 时,我收到此错误:

~/projects/ada:gnatmake hello.adb
gcc -c hello.adb
hello.adb:1:06: file "aws.ads" not found
hello.adb:2:06: file "aws.ads" not found
hello.adb:3:06: file "aws.ads" not found
hello.adb:4:06: file "aws.ads" not found
gnatmake: "hello.adb" compilation error

如何确保 AWS 已正确安装,或者如果未正确安装则移动它?

I installed Ada and AWS on a Macbook for the first time tonight.

Everything seemed successful with the installation, but I'm getting the feeling that AWS didn't install to the right directory.

GNAT is in /usr/local/gnat.

The AWS makefile.conf said,

AWS will be installed under $(prefix). Update this variable to point to
the install directory. By default, it is set to the current GNAT root
directory to have AWS project files automatically available.

So I didn't change the target.

But when I try to compile hello_world from anywhere on the system except the AWS demos folder, I get this error:

~/projects/ada:gnatmake hello.adb
gcc -c hello.adb
hello.adb:1:06: file "aws.ads" not found
hello.adb:2:06: file "aws.ads" not found
hello.adb:3:06: file "aws.ads" not found
hello.adb:4:06: file "aws.ads" not found
gnatmake: "hello.adb" compilation error

How can I make sure AWS was installed properly, or move it if it wasn't?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自唱情﹋歌 2024-12-21 13:57:35

答案(嗯,更多的是对知情者的提示)在于“让 AWS 项目文件自动可用”。

在 GNAT 上下文中,“项目文件”是指 .gpr 类型的文件,它告诉构建器(gnatmakegprbuild)在哪里可以找到源文件,如何编译它们,以及在哪里可以找到“这个”项目所依赖的库。

创建hello.gpr:(

with "aws";
project Hello is
   for Main use ("hello.adb");
end Hello;

这是非常最小),然后

with AWS;
with Ada.Text_IO;
procedure Hello is
begin
   Ada.Text_IO.Put_Line ("AWS version is " & AWS.Version);
end Hello;

使用

gprbuild -P hello.gpr

输出

AWS version is 2.10.0w

进行编译gprbuildgnatmakegnatmake 已被 gprbuild 取代);您安装的 GNAT 中可能有信息(子目录)${prefix}/share/doc

The answer (well, more of a hint to those in the know) lies in the words "to have AWS project files automatically available".

In the GNAT context, "project file" means a file of type .gpr which tells the builder (gnatmake or gprbuild) where to find the source files, how to compile them, and where to find any libraries that "this" project depends on.

Create hello.gpr:

with "aws";
project Hello is
   for Main use ("hello.adb");
end Hello;

(which is very minimal) then

with AWS;
with Ada.Text_IO;
procedure Hello is
begin
   Ada.Text_IO.Put_Line ("AWS version is " & AWS.Version);
end Hello;

compiled with

gprbuild -P hello.gpr

outputs

AWS version is 2.10.0w

There is on-line information on gprbuild and gnatmake (gnatmake has been superseded by gprbuild); there is probably information in your installed GNAT at (subdirectories of) ${prefix}/share/doc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文