home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!unipalm!uknet!mcsun!sun4nl!cwi.nl!robertl
- From: robertl@cwi.nl (Robert van Liere)
- Newsgroups: comp.sys.sgi
- Subject: Re : How to link C object with Fortran library
- Message-ID: <6784@charon.cwi.nl>
- Date: 26 Jul 92 15:14:23 GMT
- Sender: news@cwi.nl
- Organization: CWI, Amsterdam
- Lines: 40
-
-
- (I tried mailing but the message bounced...)
-
- I saw your posting in comp.sys.sgi on linking C objects with fortran
- libraries.
-
- The undefines you get are due to the zillions of internal
- functions the fortran compiler generates when compiling a fortran
- source. Try 'nm sub.o | grep wsle' which shows that these names are
- undefined in your fortran object.
-
- You can solve your problems in two ways :
-
- 1. Let the fortran compiler driver call the UNIX linker; i.e.
-
- f77 -o main main.o sub.o
-
- The fortran compiler driver will call the linker with the
- appropriate libraries.
-
- 2. Explicitly provide the C compiler driver with the
- appropriate fortran libraries; i.e.
-
- cc -o main main.o sub.o -lF77 -lI77 -lU77 -lisam -lm
-
- The C compiler driver will call the linker with the
- appropriate fortran libraries.
-
-
- Good luck,
-
- -- Robert van Liere
-
-
-
- --
- Robert van Liere, Department of Interactive Systems,
- Center for Mathematics and Computer Science (CWI)
- Kruislaan 413, 1098 SJ Amsterdam, The Netherlands
- email: robertl@cwi.nl | tel: +31-20-592-4118 | fax: +31-20-592-4199
-