comp.lang.ada
 help / color / mirror / Atom feed
* newbie ada question
@ 2010-03-23  0:34 Robin
  2010-03-23  7:59 ` Ludovic Brenta
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Robin @ 2010-03-23  0:34 UTC (permalink / raw)


How can I design an ada library that other ada programs can include
and how do I include the library in the other ada files?

Thanks,
-Robin



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

* Re: newbie ada question
  2010-03-23  0:34 newbie ada question Robin
@ 2010-03-23  7:59 ` Ludovic Brenta
  2010-03-23 10:46 ` Gautier write-only
  2010-03-26 16:58 ` kug1977
  2 siblings, 0 replies; 5+ messages in thread
From: Ludovic Brenta @ 2010-03-23  7:59 UTC (permalink / raw)


Robin wrote on comp.lang.ada:
> How can I design an ada library that other ada programs can include
> and how do I include the library in the other ada files?

This depends on your compiler and host operating system.  If you are
more specific, then someone can give you a "recipe".

Generally speaking, you write your library as a set of Ada packages,
separating specifications from bodies, and you compile all these
bodies into a library.  You then provide the specifications for use by
the programs.  Some compilers require that you also provide the bodies
for generic units.

--
Ludovic Brenta.



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

* Re: newbie ada question
  2010-03-23  0:34 newbie ada question Robin
  2010-03-23  7:59 ` Ludovic Brenta
@ 2010-03-23 10:46 ` Gautier write-only
  2010-05-01 21:24   ` Robin
  2010-03-26 16:58 ` kug1977
  2 siblings, 1 reply; 5+ messages in thread
From: Gautier write-only @ 2010-03-23 10:46 UTC (permalink / raw)


An example (with GNAT you need to make 3 files out of it: lib_1.ads,
lib_2.ads, my_prog.adb) :

-- A standalone library
package Lib_1 is
  hello: String:= "Hello from library 1 !";
end;

-- Library 2 is using Library 1
with Lib_1;
package Lib_2 is
  hello: String:= Lib_1.hello;
end;

-- An application using Library 2 (and indirectly Library 1)
with Lib_2, Ada.Text_IO;
procedure My_prog is
begin
  Ada.Text_IO.Put(Lib_2.hello);
end;
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: For a direct answer, e-mail address on the following web site:
http://www.fechtenafz.ethz.ch/wm_email.htm



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

* Re: newbie ada question
  2010-03-23  0:34 newbie ada question Robin
  2010-03-23  7:59 ` Ludovic Brenta
  2010-03-23 10:46 ` Gautier write-only
@ 2010-03-26 16:58 ` kug1977
  2 siblings, 0 replies; 5+ messages in thread
From: kug1977 @ 2010-03-26 16:58 UTC (permalink / raw)


On 23 Mrz., 01:34, Robin <rob...@cnsp.com> wrote:
> How can I design an ada library that other ada programs can include
> and how do I include the library in the other ada files?
>
> Thanks,
> -Robin

Maybe this link will be helpful:

http://homepage.ntlworld.com/ian.sharpe/isharpe/technote/ada_sl.htm



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

* Re: newbie ada question
  2010-03-23 10:46 ` Gautier write-only
@ 2010-05-01 21:24   ` Robin
  0 siblings, 0 replies; 5+ messages in thread
From: Robin @ 2010-05-01 21:24 UTC (permalink / raw)


Thanks for your answer :-) I appreciate it.....Robin, haver a good
day, and be safe.

Gautier write-only wrote:
> An example (with GNAT you need to make 3 files out of it: lib_1.ads,
> lib_2.ads, my_prog.adb) :
>
> -- A standalone library
> package Lib_1 is
>   hello: String:= "Hello from library 1 !";
> end;
>
> -- Library 2 is using Library 1
> with Lib_1;
> package Lib_2 is
>   hello: String:= Lib_1.hello;
> end;
>
> -- An application using Library 2 (and indirectly Library 1)
> with Lib_2, Ada.Text_IO;
> procedure My_prog is
> begin
>   Ada.Text_IO.Put(Lib_2.hello);
> end;
> ______________________________________________________________
> Gautier's Ada programming -- http://gautiersblog.blogspot.com/
> NB: For a direct answer, e-mail address on the following web site:
> http://www.fechtenafz.ethz.ch/wm_email.htm



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

end of thread, other threads:[~2010-05-01 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-23  0:34 newbie ada question Robin
2010-03-23  7:59 ` Ludovic Brenta
2010-03-23 10:46 ` Gautier write-only
2010-05-01 21:24   ` Robin
2010-03-26 16:58 ` kug1977

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