comp.lang.ada
 help / color / mirror / Atom feed
* Ada newbie: GNAT linking error question
@ 2003-05-11 14:29 Sascha Wilde
  2003-05-11 18:05 ` Martin Krischik
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sascha Wilde @ 2003-05-11 14:29 UTC (permalink / raw)


I just tried to build the tetris example from

http://www.tc.umn.edu/~puk/tetris.txt

but the build fails during linking, saying:

    gnatlink tetris.ali
    b~tetris.o: In function `main':
    b~tetris.o(.text+0x489): undefined reference to `_ada_tetris'
    collect2: ld returned 1 exit status
    gnatlink: cannot call /usr/local/bin/gcc
    gnatmake: *** link failed.

Thirst I thought that might be caused by the fact that I used the gnat
compiler from gcc-3.2.3, so I tried the precompiled gnat-3.15p from
act, but it produced just the same error.  I checked it alsow on my
notebook, running debian-woody with gnat-14p the same result.
So my question is: what went wrong?

I'm not shure if this is here quite on-topic, because it might be more
a gnat than a Ada problem.  Please tell me if I'm OT here.
-- 
Sascha Wilde
    "Liebet eure Feinde, vielleicht schadet das ihrem Ruf" 
    (Stanislaw Jerzy Lec)



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

* Re: Ada newbie: GNAT linking error question
  2003-05-11 14:29 Sascha Wilde
@ 2003-05-11 18:05 ` Martin Krischik
  2003-05-11 20:14   ` Sascha Wilde
  2003-05-12  7:29 ` Frank Piron
  2003-05-12  8:52 ` Preben Randhol
  2 siblings, 1 reply; 7+ messages in thread
From: Martin Krischik @ 2003-05-11 18:05 UTC (permalink / raw)


Sascha Wilde wrote:

> I just tried to build the tetris example from
> 
> http://www.tc.umn.edu/~puk/tetris.txt
> 
> but the build fails during linking, saying:
> 
>     gnatlink tetris.ali

let me suggest to use

gnat make tetris.adb

instead of compiling and linking seperatly. gnat make should take care of
everything needed.

With

Regards

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




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

* Re: Ada newbie: GNAT linking error question
  2003-05-11 18:05 ` Martin Krischik
@ 2003-05-11 20:14   ` Sascha Wilde
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Wilde @ 2003-05-11 20:14 UTC (permalink / raw)


Martin Krischik <krischik@users.sourceforge.net> wrote:

> Sascha Wilde wrote:
>
>> I just tried to build the tetris example from
>> 
>> http://www.tc.umn.edu/~puk/tetris.txt
>> 
>> but the build fails during linking, saying:

> let me suggest to use
>
> gnat make tetris.adb

actually that is exactly what I did...  But when gnatmake calls the
linker (after compiling) the error occurs.

-- 
Sascha Wilde : "GUIs normally make it simple to accomplish simple 
             : actions and impossible to accomplish complex actions."
             : (Doug Gwyn - 22/Jun/91 in comp.unix.wizards)




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

* Re: Ada newbie: GNAT linking error question
  2003-05-11 14:29 Sascha Wilde
  2003-05-11 18:05 ` Martin Krischik
@ 2003-05-12  7:29 ` Frank Piron
  2003-05-12  8:52 ` Preben Randhol
  2 siblings, 0 replies; 7+ messages in thread
From: Frank Piron @ 2003-05-12  7:29 UTC (permalink / raw)


Sascha Wilde schrieb:
> 

> but the build fails during linking, saying:
> 
>     gnatlink tetris.ali
>     b~tetris.o: In function `main':
>     b~tetris.o(.text+0x489): undefined reference to `_ada_tetris'
>     collect2: ld returned 1 exit status
>     gnatlink: cannot call /usr/local/bin/gcc
>     gnatmake: *** link failed.
> 
Consider to append: ...  -largs -L<path_to_some_library> to the
gnatmake command-line for telling the linker where some needed
library resides.

Frank Piron



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

* Re: Ada newbie: GNAT linking error question
  2003-05-11 14:29 Sascha Wilde
  2003-05-11 18:05 ` Martin Krischik
  2003-05-12  7:29 ` Frank Piron
@ 2003-05-12  8:52 ` Preben Randhol
  2003-05-12 18:34   ` Sascha Wilde
  2 siblings, 1 reply; 7+ messages in thread
From: Preben Randhol @ 2003-05-12  8:52 UTC (permalink / raw)


Sascha Wilde wrote:
> I just tried to build the tetris example from
> 
> http://www.tc.umn.edu/~puk/tetris.txt
> 
> but the build fails during linking, saying:
> 
>     gnatlink tetris.ali
>     b~tetris.o: In function `main':
>     b~tetris.o(.text+0x489): undefined reference to `_ada_tetris'
>     collect2: ld returned 1 exit status
>     gnatlink: cannot call /usr/local/bin/gcc
>     gnatmake: *** link failed.

gnatmake atetris

> I'm not shure if this is here quite on-topic, because it might be more
> a gnat than a Ada problem.  Please tell me if I'm OT here.

No it is neither OT nor an Ada problem. It is just that you have to
compile on of the atetris.ads, otetris.ads, wtetris.ads files depending
on your system.

Read the atetris.ads to see why.

-- 
Preben Randhol                    http://www.pvv.org/~randhol/



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

* Re: Ada newbie: GNAT linking error question
@ 2003-05-12  8:59 Gautier direct_replies_not_read
  0 siblings, 0 replies; 7+ messages in thread
From: Gautier direct_replies_not_read @ 2003-05-12  8:59 UTC (permalink / raw)
  To: comp.lang.ada

You surely have two or more overlapping GCCs.
On GNAT 3.15p/Win32 you obtain

C:\Temp>gnatchop tt.txt
splitting tt.txt into:
   screen.ads
   arrival.adb
   arrival.ads
   bricks.adb
   bricks.ads
   screen.adb
   tetris.adb
   wall.adb
   wall.ads
   wtetris.ads
   tetris.ads
   win_get_immediate.ads
   win_get_immediate.adb
   dtetris.ads
   atetris.ads
   dos_get_immediate.ads
   dos_get_immediate.adb
   openada_get_immediate.adb
   openada_get_immediate.ads
   otetris.ads

C:\Temp>gnatmake wtetris
gcc -c wtetris.ads
gcc -c tetris.adb
gcc -c win_get_immediate.adb
gcc -c arrival.adb
gcc -c bricks.adb
gcc -c screen.adb
gcc -c wall.adb
gnatbind -x wtetris.ali
gnatlink wtetris.ali

C:\Temp>
________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail




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

* Re: Ada newbie: GNAT linking error question
  2003-05-12  8:52 ` Preben Randhol
@ 2003-05-12 18:34   ` Sascha Wilde
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Wilde @ 2003-05-12 18:34 UTC (permalink / raw)


Preben Randhol <randhol+abuse@pvv.org> wrote:

> Sascha Wilde wrote:
>> I just tried to build the tetris example from
>> 
>> http://www.tc.umn.edu/~puk/tetris.txt

> gnatmake atetris

Thanks, that works.  I should have found that my self...
I looked at otetris, wtetris and finaly decided that tetris should be
right -- I coult swear atetris wasn't there yesterday... ;-) 

-- 
Sascha Wilde   -.-. ..- .-. .. --- ... .. - -.-- 
               -.- .. .-.. .-.. . -.. 
               - .... .
               -.-. .- -



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

end of thread, other threads:[~2003-05-12 18:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-12  8:59 Ada newbie: GNAT linking error question Gautier direct_replies_not_read
  -- strict thread matches above, loose matches on Subject: below --
2003-05-11 14:29 Sascha Wilde
2003-05-11 18:05 ` Martin Krischik
2003-05-11 20:14   ` Sascha Wilde
2003-05-12  7:29 ` Frank Piron
2003-05-12  8:52 ` Preben Randhol
2003-05-12 18:34   ` Sascha Wilde

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