Shaaz WahCantt
Shaaz WahCantt

Reputation: 1

GNAT How to make first array ada program, no languages defined for this project

I have Windows 10 64bit and I installed GNAT programming studio (no settings are made like java jdk) just installed. I want to make my first Ada programe in GPS GNAT programming studio.

Based on this example, following is Arrayproject.adb:

with Ada.Text_IO;
with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;
use Ada.Text_IO;

procedure Arrayproject is

type MyArray is array (1 .. 16) of Integer;

procedure put(s: MyArray) is
    begin
    for i in s'range loop
        Put (s(i), Width =>4);
    end loop;
    new_line;
end put;

s: MyArray := (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26);
d: MyArray := s;

begin
put_Line ("Chunks of source Array");
put(s);
put_Line ("Chunks of destination of array");
d(1 .. 4) :=s(9 .. 12);
d(5 .. 8) :=s(1 .. 4);
d(9 .. 12) :=s(13 .. 16);
d(13 .. 16) :=s(5 .. 8);
put (d);
end Arrayproject;

This code is compiling fine in online Ada compiler, but I do not know how to use it in GNAT programming studio. Error is coming that no languages defined for this project.

Following is khurram.gpr. Please help me making gpr and compiling.

Project Khurram is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Main use ("Arrayproject.adb");
end Khurram;

Upvotes: 0

Views: 826

Answers (1)

egilhh
egilhh

Reputation: 6430

Define a language in your .gpr-file:

for Languages use ("Ada");

Upvotes: 7

Related Questions