comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: building a package -- newbie
Date: Thu, 11 Nov 2004 19:27:38 +0100
Date: 2004-11-11T19:27:38+01:00	[thread overview]
Message-ID: <1179574.14h7HiTikf@linux1.krischik.com> (raw)
In-Reply-To: 3143fb37.0411110817.6e5200da@posting.google.com

backdoc wrote:

> I am working on an assignment for my Software Engineering class.  We
> must write a package and put statistical functions in it.  I am using
> Gnat and Linux.  I've written a half dozen little applications using
> Ada.  But, this is my first experience with building my own package.
> 
> So far, I've gotten the basic main procedure written.  As long as I
> don't try to WITH my package in, it will compile, read a binary file
> and print the file contents.  It's actually the float data I will have
> to write statistical functions for.
> 
> My instructor gave us the specifications.  So, I just copied those
> into a separate file.  I plan to put the body of the package in the
> same file as the specifications.

No good. There is a special limitation in GNAT that allows only one package
per file. So you need a seperate statistal_functions.adb file.

> But, I wanted to get the main 
> procedure working with only the specifications first.
> 
> My first real question is, "what extension should I use to name my
> package?"  statistal_functions.ads?  statistal_functions.adb?

In theory you can use any name you like. But GNAT is a lot more happy if you
just use the lowercase packagename and replace '.' with '-'.

> Do I 
> need to compile it before it can be WITH'd into my main program?

No. "gnat make" will take care of everthing. Just "gnat make pkg" will do.

> I 
> compile my main procedures with "gnatgcc -c file".  Is that the same
> for the package?

"gnatgcc"? - the command for compiling ada is "gnat compile". But you are
better of using "gnat make" then "gnat compile" since "gnat make" will
compile all packages in one go. 

> Any suggestions?

Yes: Read the GNAT Documentation!

With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



  parent reply	other threads:[~2004-11-11 18:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3143fb37.0411110817.6e5200da@posting.google.com>
2004-11-11 16:25 ` building a package -- newbie Jacob Sparre Andersen
2004-11-11 18:27 ` Martin Krischik [this message]
2004-11-12  9:15   ` Martin Dowie
2004-11-12  9:54     ` Martin Krischik
2004-11-12 10:51       ` Sascha Wilde
2004-11-12  2:17 ` Steve
replies disabled

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