From: ashwath30jul77@gmail.com
Subject: Procedure defined in package body accessed by separate procedure
Date: Thu, 13 Feb 2014 04:15:11 -0800 (PST)
Date: 2014-02-13T04:15:11-08:00 [thread overview]
Message-ID: <aae6105c-fb90-42f0-b87e-6d38122fd64c@googlegroups.com> (raw)
Hello,
I am getting an error when a procedure(say Pr1) defined in a separate file invokes a procedure defined in the package(say Pk1) body(say Pr2). The compiler gives error saying that Pr2 is not declared in Pk1.
Please let me know what is the mistake I am doing.
Snapshots of source code is shown for better clarity.
Greetings.ads:
=============================
package Greetings is
procedure Hello;
procedure Goodbye;
end Greetings;
Greetings.adb:
==============================
with text_io;
use Text_IO;
package body Greetings is
procedure Hello is separate;
procedure Goodbye is separate;
procedure proc_body is
begin
put_line("body");
end;
end Greetings;
Greetings-Hello.ada:
================================
with text_io;
use Text_IO;
separate (Greetings)
procedure Hello is
begin
put_line("Hello");
Greetings.proc_body;--Compiler error here. Says proc_body is not declared in Greetings
end;
I am using GNAT pro to compile this.
Thanks in Advance
Ashwath
next reply other threads:[~2014-02-13 12:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 12:15 ashwath30jul77 [this message]
2014-02-13 13:58 ` Procedure defined in package body accessed by separate procedure G.B.
2014-02-13 16:54 ` adambeneschan
2014-02-14 6:30 ` ashwath30jul77
2014-02-14 9:22 ` Simon Wright
2014-02-13 16:32 ` Dirk Heinrichs
2014-02-13 16:43 ` adambeneschan
2014-02-13 16:57 ` Dirk Heinrichs
2014-02-13 16:59 ` Dirk Heinrichs
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox