comp.lang.ada
 help / color / mirror / Atom feed
* Building with AdaGIDE
@ 2004-02-13 16:09 Joao Dias
  2004-02-13 16:26 ` Preben Randhol
  0 siblings, 1 reply; 6+ messages in thread
From: Joao Dias @ 2004-02-13 16:09 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Hi,

I'm quite interested in learning Ada, because of the
intrinsic advantages it has, in a software engineering point of view.

To test the possibility of using it in real projects,
I would like to build a small tool for my company.

I'm starting to use gnats3.15p and AdaGIDE in WinXP;

The AdaGIDE examples compile and execute well in
examples dir, but when I build a small package of my
own, in my own dir, it compiles well, and seems to be
built as well, but no executable is generated.

It seems the linker is not running in my own case.

Am I missing something in configurations ?

Thanks in advance for any help

Jo�o Dias





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

* Re: Building with AdaGIDE
  2004-02-13 16:09 Building with AdaGIDE Joao Dias
@ 2004-02-13 16:26 ` Preben Randhol
  2004-02-13 19:16   ` Joao Dias
  0 siblings, 1 reply; 6+ messages in thread
From: Preben Randhol @ 2004-02-13 16:26 UTC (permalink / raw)


On 2004-02-13, Joao Dias <jota.dias@clix.pt> wrote:
> The AdaGIDE examples compile and execute well in
> examples dir, but when I build a small package of my
> own, in my own dir, it compiles well, and seems to be
> built as well, but no executable is generated.

You say a small package. Did you also make a main program?

-- 
"Saving keystrokes is the job of the text editor, not the programming
 language."



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

* Re: Building with AdaGIDE
  2004-02-13 16:26 ` Preben Randhol
@ 2004-02-13 19:16   ` Joao Dias
  2004-02-13 20:49     ` Robert I. Eachus
  0 siblings, 1 reply; 6+ messages in thread
From: Joao Dias @ 2004-02-13 19:16 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]



"Preben Randhol" wrote

> You say a small package. Did you also make a main program?

-------------------------------------------------------------

If I failed something like that (wich seems very likely) then

I think I am not prepared yet to start compiling examples.

I have to find time for keep reading the docu I have downloaded, cause I am
missing something (a lot actually). Although I'm very satisfied with what
I've

seen about the language implementation, so far.

My code example is that one (totoloto is some form of loto and chave is the
group of balls extracted - just forget any non-sense of the design)

I only wrote two very simple files totoloto.ads and totoloto.adb like this:

totoloto.ads

--------------------------------

package Totoloto is

Ultima_Bola : Integer := 49; --last ball number

Numero_Bolas_Chave : Integer := 7; --number of balls normally extracted

type Chave is array (1 .. 7) of Integer;

function Sorteia_Chave return Chave;

end Totoloto;

--------------------------------

totoloto.adb

--------------------------------

with Ada.Integer_Text_IO;

package body Totoloto is

Chave2: Chave;



function Sorteia_Chave return Chave is -- extracts some balls

Chave1: Chave;

begin



Chave1(1):=6;

Chave1(2):=32;

return Chave1;



end Sorteia_Chave;





begin -- I suposed that was the main progam !

Chave2:= Sorteia_Chave;

Ada.Integer_Text_Io.Put(Chave2(1),Chave2(2)); --print 2 extracted balls



end Totoloto;

------------------------------------------------

building...

"totoloto.ali" being checked ...

End of compilation

Completed sucessfully. (and nothing more)

Jo�o Dias





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

* Re: Building with AdaGIDE
  2004-02-13 19:16   ` Joao Dias
@ 2004-02-13 20:49     ` Robert I. Eachus
  2004-02-14  9:02       ` Marin David Condic
  0 siblings, 1 reply; 6+ messages in thread
From: Robert I. Eachus @ 2004-02-13 20:49 UTC (permalink / raw)


Joao Dias wrote:

> "Preben Randhol" wrote
> 
> 
>>You say a small package. Did you also make a main program?


> begin -- I suposed that was the main progam !
> 
> Chave2:= Sorteia_Chave;
> 
> Ada.Integer_Text_Io.Put(Chave2(1),Chave2(2)); --print 2 extracted balls

> end Totoloto;

Yep, you forgot to have a main program.  In Ada there is nothing wrong 
with not having a main program for some partition.  But you need at 
least one main program somewhere.  Try compiling:

with Totoloto;
procedure Main is begin null; end Main;

You should get an executable, and hopefully the results you expected. 
You can move the lines of code above into the main program, but if you 
do you will want "use Totoloto;" somewhere.
-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




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

* Re: Building with AdaGIDE
  2004-02-13 20:49     ` Robert I. Eachus
@ 2004-02-14  9:02       ` Marin David Condic
  2004-02-16 17:52         ` Joao Dias
  0 siblings, 1 reply; 6+ messages in thread
From: Marin David Condic @ 2004-02-14  9:02 UTC (permalink / raw)


We should probably note that while Joao's example will actually work 
with a begin-end block in the package & having an empty main program, 
that this is not the way it is normally done. I'd suggest to Joao that 
he first get a "Hello World" program running and then start 
experimenting with adding things to it. Packages are nice and powerful, 
but a beginner should probably stick to getting the basics to work first.

MDC

Robert I. Eachus wrote:
> 
> You should get an executable, and hopefully the results you expected. 
> You can move the lines of code above into the main program, but if you 
> do you will want "use Totoloto;" somewhere.


-- 
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm

Send Replies To: m   o   d   c @ a   m   o   g
                    c   n   i       c   .   r

     "Face it ladies, its not the dress that makes you look fat.
     Its the FAT that makes you look fat."

         --  Al Bundy

======================================================================




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

* Re: Building with AdaGIDE
  2004-02-14  9:02       ` Marin David Condic
@ 2004-02-16 17:52         ` Joao Dias
  0 siblings, 0 replies; 6+ messages in thread
From: Joao Dias @ 2004-02-16 17:52 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

Than you for your help

I've been out for a couple of days, but soon I will restart with Ada and
will
do what you suggested.

Jo�o Dias





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

end of thread, other threads:[~2004-02-16 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-13 16:09 Building with AdaGIDE Joao Dias
2004-02-13 16:26 ` Preben Randhol
2004-02-13 19:16   ` Joao Dias
2004-02-13 20:49     ` Robert I. Eachus
2004-02-14  9:02       ` Marin David Condic
2004-02-16 17:52         ` Joao Dias

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