comp.lang.ada
 help / color / mirror / Atom feed
* Ada interface to fortran
@ 1995-03-16  0:04 Keith Euler
  0 siblings, 0 replies; only message in thread
From: Keith Euler @ 1995-03-16  0:04 UTC (permalink / raw)


I am attempting to integrate some fortran code into an Ada program.  When I 
link I get a the following message.

ld:Undefined Symbol
  __lib_version

The linker actually generates an executable that appears to work just fine.
The only place I can find any reference to this symbol is in the "lib<x>.a
files supplied with the fortran compiler.

I am using the Sun (Verdix) Ada compiler version 1.1 and the Sun supplied 
F77 fortran compiler.

All the fortran code was compiled as follows "f77 -c <filename.f>

The Ada procedure that calls this routine contains the following:

   Ada spec for the fortran body:

       procedure interface(A : in SYSTEM.Address;
                           B : in SYSTEM.Address;
                           C : in SYSTEM.Address;
                           D : in SYSTEM.Address);

       NOTE: D is the return value.

   Pragmas to allow linking with the fortran libraries:

      pragma LINK_WITH("/apps/lang/SC2.0.1/libF77.a");
      pragma LINK_WITH("/apps/lang/SC2.0.1/libansi.a");
      pragma LINK_WITH("/apps/lang/SC2.0.1/libm.a");

   Pragma to interface the ada to the fortran:

      pragma INTERFACE(FORTRAN, interface);

   Pragma to allow ada to link with the fortran module being called:

      pragma LINK_WITH("interface.o");

   Actual call to the fortran code.  All parameters are records:

      interface( A'Address,
                 B'Address,
                 C'Address,
                 D'Address);

The command being used to link the code is as follows:

   a.ld  interface_test -o interface_test -L/apps/lang/SC2.0.1 -lF77 -lansi -lm

   NOTE: interface_test is the name of the Ada procedure that contains the above
         declarations.

I would apreciate any light you may be able to shed on this problem.  I have tried to
many things to mention and can't get rid of this message.  Any suggestions on how
to isolate the problem would also be apreciated.



Thanks in advance,

Keith Euler (keuler@skopen.dseg.ti.com)



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-03-16  0:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-16  0:04 Ada interface to fortran Keith Euler

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