From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d587466310393853 X-Google-Attributes: gid103376,public From: rodemann@mathematik.uni-ulm.de (Joerg Rodemann) Subject: Re: importing fortran routines to GNAT Date: 1997/02/21 Message-ID: <5eke6f$5tu@arktur.rz.uni-ulm.de>#1/1 X-Deja-AN: 220431096 References: <330DBC84.219B@msslac.mssl.ucl.ac.uk> Organization: University of Ulm, SAI, Germany Newsgroups: comp.lang.ada Date: 1997-02-21T00:00:00+00:00 List-Id: Pasi J. Hakala (pjh@msslac.mssl.ucl.ac.uk) wrote: > Here's what I've done (This is under OS/2 with g77, gcc 2.7... and > emx 0.9c): > - gcc -c amain.adb (no complaints) > - g77 -c subsum.f (no complaints) > - gnatbind amain.ali (no complaints) > - gnatlink amain.ali subsum.o > which results in 'cannot find object _subsum etc.... Hello Pasi! I just tried your example under HP-UX10.10 (GNAT3.05, HP-f77) and SunOS 5.5.1 (Solaris 2.5??, Sun-f77). This lead to the following results: HP: just working fine. Sun: linker complains about undefined symbol subsum_ It seem that the various compiler have different internal naming conventions for functions. On the Sun platform I could solve the problem by using a slightly different Import-statement: > procedure subsum(In1 : in Real; In2 : in Real ; Outsum : out Real); > pragma import(Fortran,subsum, "subsum_"); The third parameter is the name to be found in the object file as far as I understand this materia. So in your case a pragma import(Fortran,subsum, "_subsum"); should work. Hope this helps Greetings George -- Joerg 'George' Rodemann Erhard-Groezinger-Strasse 82 Department of Physics D-89134 Blaustein University of Ulm Tel. (0731) 553319 e-mail: rodemann@mathematik.uni-ulm.de