2011-11-09 55 views
2

我今晚第一次在Macbook上安裝了Ada和AWS。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演示文件夾中的系統上的任何地方編譯程序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已正確安裝,或移動它,如果它WASN 「T?

回答

4

答案(以及更多對知情者的暗示)在於「讓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