comp.lang.ada
 help / color / mirror / Atom feed
From: Per Sandberg <per.sandberg@bredband.net>
To: Ben Horowitz <bhorowitdevnull@yahoo.com>
Cc: comp.lang.ada@ada-france.org
Subject: Re: Compilation error with GNAT
Date: Thu, 29 Jan 2004 06:56:25 +0100
Date: 2004-01-29T06:56:25+01:00	[thread overview]
Message-ID: <mailman.59.1075355799.2270.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <6c8918f3.0401281100.2a000840@posting.google.com>

Start with the basic GNAT complilation model.
GNAT is treating spec/body alternativly spec if the spec does'nt requrie 
a body as a unit for compilation.

Asume the folowing:

package no_body is
end no_body;

package with_body is
   procudere dummy;
end with_body;

package with_body is
   procudere dummy is begin null;end;
end with_body;

Then you will be able to generate code for no_body'spec and 
with_body'spec/with_body'body.
The compiler will compilain when you are trying to generate code from 
with_body'spec since that file wont generate any code.

You will get code from no_body'spec when compiling the source file 
no_body.1.ada and from the pair with_body'spec/with_body'body when 
compiling with_body.2.ada.

It is all explaind in detail in the GNAT documentation
/Per Sandberg



Ben Horowitz wrote:
> Hi,
> 
> I'm trying to sort through a compilation problem that I'm having with
> Gnat.  I have a large set of source files, some of which are spec
> only, and some of which have both spec and body.  The file that is
> giving me a problem has only a spec.  I am using the XXX.1.ada and
> XXX.2.ada naming convention.
> 
> I first try to compile this file using gnatmake and the project file
> below.  Gnat complains that the file has only a spec, so it can't
> generate code.  Later, it reports a compilation error.  The output of
> gnatmake and the project file I used are given below.
> 
> I thought at first that the problem might be that I needed to use the
> -gnatc option to gnat/gcc for the troublesome file.  I tried this (see
> the second compilation run below).  Gnatmake now warns that an ALI or
> object file is missing after compile.  Gnatmake nonethess goes on,
> ending up by reporting a compilation error that seems quite similar to
> the first.
> 
> What might be causing this problem?  What are the possible fixes?
> 
> Of course, one solution would be to give the troublesome file a (more
> or less) empty body.  However, I wish to avoid this, as it requires a
> large amount of manual labor.
> 
> Thanks,
> Ben



  parent reply	other threads:[~2004-01-29  5:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-28 19:00 Compilation error with GNAT Ben Horowitz
2004-01-28 21:13 ` Simon Wright
2004-01-28 23:07 ` Dan Eilers
2004-01-29  5:56 ` Per Sandberg [this message]
2004-01-29 17:37   ` Dan Eilers
replies disabled

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