comp.lang.ada
 help / color / mirror / Atom feed
From: Andy Willey <willeya@dr-inc.com>
Subject: Multilanguage Interfacing
Date: 1998/03/01
Date: 1998-03-01T00:00:00+00:00	[thread overview]
Message-ID: <34F9AD84.8660F98D@dr-inc.com> (raw)


I am attempting to perform the following simple test to check out the
Ada-FORTRAN interface.  I wish to call the FORTRAN routine "output" from
an Ada main routine "test".  Using g77, I have compiled the FORTRAN
routine below and created a file called "output.o".  Using GNAT, I have
compiled and bound the Ada main program below and created the file
"test.ali".  Up to this point, no problems.  However, when I attempt to
link the ada and FORTRAN together using gnatlink test.ali output.o, the
linker complains about unknown symbols in the FORTRAN module.  Can
anyone explain why this isn't working?  Thanks in advance.

-- Andy Willey, willeya@dr-inc.com

Summary of actions:
g77 -c output.f
gcc -c test.adb
gnatbind test.ali
gnatlink test.ali output.o

Ada Main routine contained in file test.adb:

with Interfaces.Fortran;
use Interfaces.Fortran;
procedure test is
   procedure output; --Declare FORTRAN routine to be called
   pragma Import (Fortran, output, "output_"); --This may be the problem

begin
   output; --Call FORTRAN routine
end test;

FORTRAN Routine contained in file output.f:

      subroutine output
      write(05,*)'Test Successful!'
      return
      end

**End of message**





             reply	other threads:[~1998-03-01  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-01  0:00 Andy Willey [this message]
1998-03-01  0:00 ` Multilanguage Interfacing Robert Dewar
replies disabled

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