home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sgi / 11402 < prev    next >
Encoding:
Internet Message Format  |  1992-07-26  |  1.4 KB

  1. Path: sparky!uunet!pipex!unipalm!uknet!mcsun!sun4nl!cwi.nl!robertl
  2. From: robertl@cwi.nl (Robert van Liere)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re : How to link C object with Fortran library
  5. Message-ID: <6784@charon.cwi.nl>
  6. Date: 26 Jul 92 15:14:23 GMT
  7. Sender: news@cwi.nl
  8. Organization: CWI, Amsterdam
  9. Lines: 40
  10.  
  11.  
  12. (I tried mailing but the message bounced...)
  13.  
  14. I saw your posting in comp.sys.sgi on linking C objects with fortran
  15. libraries. 
  16.  
  17. The undefines you get are due to the zillions of internal
  18. functions the fortran compiler generates when compiling a fortran 
  19. source. Try 'nm sub.o | grep wsle' which shows that these names are 
  20. undefined in your fortran object.
  21.  
  22. You can solve your problems in two ways :
  23.  
  24.     1. Let the fortran compiler driver call the UNIX linker; i.e.
  25.  
  26.         f77 -o main main.o sub.o
  27.  
  28.        The fortran compiler driver will call the linker with the
  29.        appropriate libraries.
  30.  
  31.     2. Explicitly provide the C compiler driver with the
  32.        appropriate fortran libraries; i.e.
  33.  
  34.         cc -o main main.o sub.o -lF77 -lI77 -lU77 -lisam -lm
  35.  
  36.        The C compiler driver will call the linker with the
  37.        appropriate fortran libraries.
  38.  
  39.  
  40. Good luck,
  41.  
  42. -- Robert van Liere
  43.  
  44.  
  45.  
  46. -- 
  47. Robert van Liere, Department of Interactive Systems,
  48. Center for Mathematics and Computer Science (CWI)
  49. Kruislaan 413,  1098 SJ  Amsterdam,  The Netherlands
  50. email: robertl@cwi.nl | tel: +31-20-592-4118 | fax: +31-20-592-4199
  51.