comp.lang.ada
 help / color / mirror / Atom feed
* Procedure defined in package body accessed by separate procedure
@ 2014-02-13 12:15 ashwath30jul77
  2014-02-13 13:58 ` G.B.
  2014-02-13 16:32 ` Dirk Heinrichs
  0 siblings, 2 replies; 9+ messages in thread
From: ashwath30jul77 @ 2014-02-13 12:15 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-02-14  9:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 12:15 Procedure defined in package body accessed by separate procedure ashwath30jul77
2014-02-13 13:58 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox