comp.lang.ada
 help / color / mirror / Atom feed
* Linking FORTRAN77 to Ada83
@ 1999-06-09  0:00 Guy Calinsky
  1999-06-09  0:00 ` David C. Hoos, Sr.
  1999-06-10  0:00 ` bob
  0 siblings, 2 replies; 4+ messages in thread
From: Guy Calinsky @ 1999-06-09  0:00 UTC (permalink / raw)


I have a subroutine written in FORTRAN that I need to link with my Ada
83 code, but I am getting an Undefined Symbol error on that subroutine.
I followed the pragma example in the LRM (13.9).
Here is a small app I created to test the concept:
----------------------

with Text_io;  use Text_io;
with Long_Float_io; use Long_Float_io;

procedure Ada_Main  is

   procedure root(A : Long_Float; B : Long_Float; C : Long_Float; Result
: out Long_Float);
   pragma Interface(Fortran, root);

   result : Long_Float;

begin

   root(1.0, 2.0, 1.0, result);
   put("result = "); put(result); new_line;

end Ada_Main;
----------------------

My FORTRAN subroutine :
        subroutine root(a, b, c, x)
        implicit none
        real a, b, c, x
        x = SQRT(b**2 - 4.0 * a * c) / (2.0 * a)
        return
        end
----------------------

My Make script :
f77 -Xlist -g -C  root.for
ada ada_main.a
a.ld -o ada_fortran_test ada_main root.o
----------------------

Everything compiles ok and root.o does exist, yet I get this result :
Undefined                       first referenced
 symbol                             in file
root
/home/calinsky/Fortran_Ada_Test/.objects/ada_main01
ld: fatal: Symbol referencing errors. No output written to
ada_fortran_test


Any thoughts or ideas?
Thanks,
Guy





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

end of thread, other threads:[~1999-06-10  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-09  0:00 Linking FORTRAN77 to Ada83 Guy Calinsky
1999-06-09  0:00 ` David C. Hoos, Sr.
1999-06-10  0:00   ` Robert Dewar
1999-06-10  0:00 ` bob

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