Reputation: 1335
I have to learn Ada so I can write an interpreter for it. But I cannot find many resources on learning the language. I get the above message when attempting to compile the following code: I save the file as check_positive.adb
. What else am I supposed to do? I ran gnatls Check_Positive.adb
after I ran gnatchop -w Check_Positive.adb
. I am using GNAT Community v5.1.0.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Check_Positive is
N : Integer;
begin
Put ("Enter an integer value: "); -- Put a String
Get (N); -- Read in an integer value
if N > 0 then
Put (N); -- Put an Integer
Put_Line (" is a positive number");
end if;
end Check_Positive;
Upvotes: 0
Views: 138
Reputation: 6430
gnatls
and gnatchop
will not compile your code, you should try gnatmake
:
gnatmake check_positive.adb
be aware that GNAT expects lower-case filenames and one procedure/function/package spec/package body per file. If you organize your code that way, you won't need gnatchop.
Upvotes: 3