From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,88ff5f2594f7f64a X-Google-Attributes: gidfee84,public From: lionel@quark.zko.dec.com (Steve Lionel) Subject: Re: cc and f77 linking : libraries required ? Date: 1996/08/27 Message-ID: <4vvir4$q9t@nntpd.lkg.dec.com>#1/1 X-Deja-AN: 176818476 distribution: world sender: lionel@quark.enet.dec.com (Steve Lionel) references: <4vsbeb$d3g_001@iroe.fi.cnr.it> organization: Digital Equipment Corporation, Nashua NH reply-to: lionel@quark.zko.dec.com (Steve Lionel) newsgroups: comp.unix.osf.osf1 In article <4vsbeb$d3g_001@iroe.fi.cnr.it>, menca@iroe.iroe.fi.cnr.it (Dr Francesco Mencaraglia) writes: |>sorry if this question has been already posed N times ( N >> 1), but I could |>not find the answer in the osf FAQ. I am trying to compile a C programs which |>calls fortran-77 routines. what I do is: |>f77 -c routine.f |>cc -c programc |>cc program.o routine.o -lUfor -lfor -lm |>but I get a few unresolved symbols (something like _Ots....); inspecting |>/usr/lib I found some libraries libots.a libots2.a but this was not enough. Use the f77 driver to do the linking. It will add the proper libraries. You must also add -nofor_main if the main program is not Fortran. You can use the f77 driver to compile the C code as well. For example: f77 -nofor_main routine.f program.c For further information, please see the Digital Fortran User Manual. -- Steve Lionel mailto:lionel@quark.zko.dec.com Fortran Development http://www.digital.com/info/slionel.html Digital Equipment Corporation 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" For information on Digital Fortran, see http://www.digital.com/info/hpc/fortran/