gpt4 book ai didi

AWS for Ada 的安装问题

转载 作者:行者123 更新时间:2023-12-01 11:03:55 25 4
gpt4 key购买 nike

我今晚第一次在 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 已正确安装,如果未正确安装,如何移动它?

最佳答案

答案(好吧,更多的是对知情者的提示)在于“让 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

gprbuild网上有资料和 gnatmake (gnatmake 已被 gprbuild 取代);在 ${prefix}/share/doc(的子目录)中安装的 GNAT 中可能有信息。

关于AWS for Ada 的安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8063468/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com