comp.lang.ada
 help / color / mirror / Atom feed
* ADA compile problem
@ 1998-11-11  0:00 Clifford R. Conover
  1998-11-12  0:00 ` grave
  0 siblings, 1 reply; 2+ messages in thread
From: Clifford R. Conover @ 1998-11-11  0:00 UTC (permalink / raw)


I'm having a little trouble getting GNAT to run on my RedHat 5.2 box.

I followed your directions about building that object using this script

#!/bin/tcsh -f
foreach f (../adainclude/*.ad[bs])
  gcc -c -O2 -gnatg -I- $f
end

Then I executed:

mv libgnat.a libgnat.a.old 

ar q libgnat.a *.o

rm *.o

ranlib libgnat.a

Then I tried to build the hello example program and got these errors:

[rconover@testb examples]$ gnatmake hello.adb
gnatbind -x hello.ali
gnatlink hello.ali
b_hello.o: In function `adainit':
b_hello.o(.text+0x13): undefined reference to `__gnat_set_globals'
b_hello.o: In function `main':
b_hello.o(.text+0x37): undefined reference to `gnat_argc'
b_hello.o(.text+0x3f): undefined reference to `gnat_argv'
b_hello.o(.text+0x47): undefined reference to `gnat_envp'
b_hello.o(.text+0x4c): undefined reference to `__gnat_initialize'
b_hello.o(.text+0x60): undefined reference to `__gnat_finalize'
b_hello.o(.text+0x65): undefined reference to `gnat_exit_status'
./hello.o: In function `_ada_hello':
./hello.o(.text+0xef): undefined reference to
`__gnat_raise_constraint_error'
./hello.o(.text+0x103): undefined reference to
`__gnat_raise_constraint_error'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(g-io.o):
In function `gnat__io__get':
g-io.o(.text+0x4): undefined reference to `get_int'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(g-io.o):
In function `gnat__io__get__2':
g-io.o(.text+0x10): undefined reference to `get_char'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(g-io.o):
In function `gnat__io__get_line':
g-io.o(.text+0x74): undefined reference to
`__gnat_raise_constraint_error'
g-io.o(.text+0xb7): undefined reference to
`__gnat_raise_constraint_error'
g-io.o(.text+0xe5): undefined reference to
`__gnat_raise_constraint_error'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(g-io.o):
In function `gnat__io__put':
g-io.o(.text+0x12b): undefined reference to `put_int'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(g-io.o):
In function `gnat__io__put__2':
g-io.o(.text+0x13d): undefined reference to `put_char'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(g-io.o):
In function `gnat__io__put__3':
g-io.o(.text+0x171): undefined reference to
`__gnat_raise_constraint_error'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(s-taspda.o):
In function `system__task_specific_data__create_tsd':
s-taspda.o(.text+0x11b): undefined reference to `__gnat_malloc'
s-taspda.o(.text+0x12e): undefined reference to
`__gnat_raise_constraint_error'
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib//libgnat.a(s-taspda.o):
In function `system__task_specific_data__destroy_tsd':
s-taspda.o(.text+0x16b): undefined reference to
`__gnat_raise_constraint_error'
s-taspda.o(.text+0x181): undefined reference to `__gnat_free'
gnatmake: *** link failed.

My environment setup:

ADA_INCLUDE_PATH=/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adainclude
ADA_OBJECTS_PATH=/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib
C_INCLUDE_PATH=/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/include
GCC_EXEC_PREFIX=/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/
LD_RUN_PATH=/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/adalib
PATH=/home/rconover/gnat/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/rconover/bin:/home/rconover/script
s:

the contents of my ada gnat lib is:

[rconover@testb adalib]$ ls -l l*           
-rw-rw-r--   1 rconover rconover  2087050 Nov 11 16:58 libgnat.a
-rwxrwxrwx   1 rconover rconover  1747844 Nov 11 16:07 libgnat.old

I'm using the rts-fsu selection of files for my adalib.
I've tried using the native selection but it didn't work either.

Gcc when run with "gcc -v" reports:

[rconover@testb 2.7.2.1]$ gcc -v
Reading specs from
/home/rconover/gnat/lib/gcc-lib/i386-linux/2.7.2.1/specs
gcc version 2.7.2.1

Do you have any suggestions on what I could be doing wrong?  Any
suggestions are appreciated.

-- 
-------------------------------------------------------------------
- Clifford "Rusty" Conover            - RConover@montana.edu      -
-------------------------------------------------------------------




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

* Re: ADA compile problem
  1998-11-11  0:00 ADA compile problem Clifford R. Conover
@ 1998-11-12  0:00 ` grave
  0 siblings, 0 replies; 2+ messages in thread
From: grave @ 1998-11-12  0:00 UTC (permalink / raw)
  To: Clifford R. Conover

Clifford R. Conover wrote:
> 
> I'm having a little trouble getting GNAT to run on my RedHat 5.2 box.
> 
> I followed your directions about building that object using this script
> 
> #!/bin/tcsh -f
> foreach f (../adainclude/*.ad[bs])
>   gcc -c -O2 -gnatg -I- $f
> end
> 

Don't you need to add the c part of it ? (gnat 3.10p)
a-adaint.c a-raise.c a-argv.c a-sysdep.c
a-cio.c a-time.c a-cstrea.c a-trans.c
a-deftar.c a-trans3.c a-errno.c a-trans4.c
a-exit.c a-uintp.c ...

> Then I executed:

> mv libgnat.a libgnat.a.old

> ar q libgnat.a *.o

> rm *.o

> ranlib libgnat.a

> Then I tried to build the hello example program and got these errors:

> [rconover@testb examples]$ gnatmake hello.adb
<snip>
> b_hello.o(.text+0x37): undefined reference to `gnat_argc'
<snip>
> In function `system__task_specific_data__destroy_tsd':
> s-taspda.o(.text+0x16b): undefined reference to
> `__gnat_raise_constraint_error'
> s-taspda.o(.text+0x181): undefined reference to `__gnat_free'
> gnatmake: *** link failed.
>

For example :

__gnat_raise_constraint_error is in a-raise.c
gnat_argc is in a-argv.c

Hope it will help...

xavier




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

end of thread, other threads:[~1998-11-12  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-11  0:00 ADA compile problem Clifford R. Conover
1998-11-12  0:00 ` grave

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