请看下面的代码
公式.ads
package Formula is
procedure CalculateFormula;
end Formula;
公式.adb
with Ada.Text_IO; use Ada.Text_IO;
with Formula; use Formula;
package body Formula is
procedure CalculateFormula is
package fom_io is new Ada.Float_Text_IO(Float);
use fom_io;
u : Float;
t : Float;
a : Float;
answer : Float;
begin
put_line("Enter 'U'");
get(u);
put_line("Enter 'T'");
get(t);
put_line("Enter 'A'");
get(a);
answer = (u*t)+ 0.5(a(t*t));
put("Answer is: ");
put(answer,Fore => 1,Aft => 1,Exp => 1);
end CalclualeFormula;
end Formula;
当我运行此代码时,出现以下错误
gnatmake -d -PC:\Users\yohan\Documents\Ada\Formula\formula.gpr
gcc -c -I- -gnatA C:\Users\yohan\Documents\Ada\Formula\formula.ads
cannot generate code for file formula.ads (package spec)
gnatmake: "C:\Users\yohan\Documents\Ada\Formula\formula.ads" compilation error
[2013-04-06 03:18:22] process exited with status 4 (elapsed time: 00.22s)
我对艾达很陌生。几个小时前开始编码。请帮助我摆脱上述问题。谢谢你。
编辑
公式.gpr
project Formula is
for Main use ("formula.ads");
end Formula;